Accessing internal version numbers in code

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
blackcattech
Posts: 113
Joined: Mon Jan 11, 2010 10:39 pm
Location: Chesterfield

Accessing internal version numbers in code

Post by blackcattech » Fri Sep 21, 2012 10:13 am

Is there any way to access the version number Swordfish stores and updates in your code? I want to add a function in my software where it shows the software version on an LCD on boot up but I can't see any way to access this number in your code. At the moment I just set it as three variables but that means I need to remember to update these on each compile which I invariably fail to do.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Fri Sep 21, 2012 10:31 am

This is what I use:

Code: Select all

Public Const
   Version = _ProjectVersion,
   VersionStr = _ProjectVersionStr,
   VersionMajor As Byte = _ProjectVersion >> 24,
   VersionMinor As Byte = _ProjectVersion >> 16,
   VersionRelease As Byte = _ProjectVersion >> 8,
   VersionBuild As Byte = _ProjectVersion

blackcattech
Posts: 113
Joined: Mon Jan 11, 2010 10:39 pm
Location: Chesterfield

Post by blackcattech » Fri Sep 21, 2012 11:13 am

Thanks, David, just what I need.

Next question... is there a record of the compile date that I can access?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Fri Sep 21, 2012 11:23 am

No, just version numbers.

Post Reply