?NotDeBug

BlitzMax Forums/BlitzMax Beginners Area/?NotDeBug

H&K(Posted 2007) [#1]
Probably being stupid, I want to define a Const, that can have two different values , depending on if its a debug build or not.
?Debug
Const Cont1:int = DebugValue
?
?Release
Const Cont1:Int = ReleaseValue
?
Now obviously this doesnt Work, and I know I could make it a Global, set it as the release value then change it if its a bedug build. But this is just the example I am using to ask. How do I ?!Debug


GfK(Posted 2007) [#2]
Looking at the bmk source you can probably add your own compiler directives. The directive definitions are in C:\Program Files\BlitzMax\src\bmk\bmk_modutil.bmx if you want to have a look.


Mark Tiffany(Posted 2007) [#3]
Watch out though - I had a play with compiler directives once before, and got in a mess. I think that some are in bmk, but some are in bcc, and some are in both!


klepto2(Posted 2007) [#4]
I have also tried to get some directives to work and simply fail. Mark seems to be right, that at least the keywords are reserved in the bcc, so currently the way to go with locals or globals instead of const.

Local Test:String = "No Debug"

?Debug
Test:String = "Debug"
?

Print Test