Want to add a version number automatically to your source code? I did today!
To resolve
So, add this to your code and you get a variable created that you can use
#include"GCBVersionNumber.cnt"
The include tells the compiler to look for a file called "GCBVersionStamp.cnt", the include will update the version number stated in "GCBVersionStamp.cnt" and the compiler will expose a string variable called buildString after you have called the method _MyInit.
under Linux Line 23 and 24 of the code could be problematic - but cannot confirm nor prove me wrong.
Could not test it. Maybe soon have a full schedule at weekend.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The challenge
Want to add a version number automatically to your source code? I did today!
To resolve
So, add this to your code and you get a variable created that you can use
The include tells the compiler to look for a file called "GCBVersionStamp.cnt", the include will update the version number stated in "GCBVersionStamp.cnt" and the compiler will expose a string variable called
buildString
after you have called the method_MyInit
.My complete code looks like this.
And, I get this on my terminal, where the 49 is my build number.
To install
Simply put the two attached files in your
..\gcb@syn\greatcowbasic\converters
folder and then #include in your program.Your filename can be any filename but the extension MUST be
cnt
.Enjoy
Last edit: Anobium 2018-04-01
Here is a much improved utility. Much easier to use and less to integrate into your program.
See the attachments
Last edit: Anobium 2018-04-01
Very nice feature.
I have posted the code here https://sourceforge.net/p/gcbasic/code/HEAD/tree/utils/Version%20Stamp/
Linux guys can see if this works.
under Linux Line 23 and 24 of the code could be problematic - but cannot confirm nor prove me wrong.
Could not test it. Maybe soon have a full schedule at weekend.