Anyone know of a way to access at runtime or build time the version number (2018r3 et al) of the IDE compiler being used to compile your Xojo program?
The constant RBVersion contains the version number of the IDE.
#if RBVersion < 2018 then
// don't use newest features
#endif
Great! Is there a way to use this info at compile time to set a constant of a simpler name that can then be used globally in an abbreviated form at compile time?
#if RBVersion > 2018.03 AND TargetMacOS AND Target64Bit Then
const isModern = true
#EndIf
#If isModern Then
// Do something more clever
#Endif
Perhaps in some kind of pre-compile script?
[quote=414633:@Ed Kleban]Great! Is there a way to use this info at compile time to set a constant of a simpler name that can then be used globally in an abbreviated form at compile time?
[/quote]
how much more abbreviate do you want?
dim s as string=RBVersionString // RBVersionString
dim v as double=RBVersion
doesn’t need to be used in a #IF statement
Or you could use much the same code in a IDE script that executes before the build step. That script can set a constant in your app then you can just test that constant. The code you posted can, and does, work but it needs to set a global constant (on App for instance) and you can do that with the style of code you’ve posted.
These may help:
http://developer.xojo.com/userguide/ide-scripting
http://developer.xojo.com/userguide/ide-scripting-commands