Menu

Great Cow BASIC utility to automatically update the version number in your source code

Anobium
2018-01-05
2018-01-26
  • Anobium

    Anobium - 2018-01-05

    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

     #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.

    My complete code looks like this.

      #include "GCBVersionNumber.cnt"
    
      dim versionString as string * 40
      versionString = "Max7219 build"+GCBBuildStr
      versionString = versionString + "@"+GCBBuildTimeStr
      Print versionString
    

    And, I get this on my terminal, where the 49 is my build number.

    Max7219 v49
    Commence main program
    

    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
  • Anobium

    Anobium - 2018-01-06

    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
  • bed

    bed - 2018-01-06

    Very nice feature.

     
    • Anobium

      Anobium - 2018-01-06

      I have posted the code here https://sourceforge.net/p/gcbasic/code/HEAD/tree/utils/Version%20Stamp/

      Linux guys can see if this works.

       
      • Boris Breuer

        Boris Breuer - 2018-01-26

        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.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.