This means these are set by the IDE, the PureBasic IDE will set the #PB_Editor_XYZ and other constants at compile time (the "editor" is the IDE).
You can also set manually a list of constants using a parameter in the command line, for multiple constants simply rinse & repeat for each:
PureBasic Help wrote:
-co, --constant, /CONSTANT name=value: creates the specified constant with the given expression. Example: 'pbcompiler test.pb /CONSTANT MyConstant=10'. The constant #MyConstant will be created on the fly with a value of 10 before the program gets compiled.
You could also set default values for the IDE constants that you are using, if you want your code to be more comfy to compile:
Code: Select all
CompilerIf Not Defined(PB_Editor_FileDescription, #PB_Constant)
#PB_Editor_FileDescription = "Default description"
; (...)
; other constants imported from the PureBasic IDE
;
CompilerEndIf
You can play with this kind of "switches" in the IDE settings in a way you could for example use a compile constant that tells if the program should compile with all features or only a demo-version of your app, to include or exclude features and such things. You could create a simple constant in the IDE, demo=1 or the opposite full_version=1, depending on what you favor for your "default compiling behavior". If it's not defined at compile time the source code could branch to be compiled as if the constant was equal to zero.
Code: Select all
; set #compile_as_demo=1 in the project target's or standalone source file's compiler options
CompilerIf Not Defined(compile_as_demo, #PB_Constant)
; here is default behavior
; before we want to turn off features in a demo, we want to focus on creating them first ;o)
; by default the full version should compile
;
; things only available in full version:
XInclude "full_version_fix.pb"
;
CompilerElseIf Not #compile_as_demo ; (same as =0)
; here the constant was set in the IDE either in the project target's settings or in the standalone source file (main source file)
; or it was manually set with /constant parameter
; or you defined it earlier in the code, but forgot about it ;)
;
; things only available in full version
XInclude "full_version_fix.pb"
;
CompilerElse
; constant was manually set to be non-zero in the IDE or manually with parameter, this means we want to build the demo version
;
XInclude "demo_version_fix.pb"
;
CompilerEndif
; demo & full versions shared code continues here
Hope I could give you some help and inspiration for experiments.