?Debug Import

BlitzMax Forums/BlitzMax Beginners Area/?Debug Import

H&K(Posted 2007) [#1]
Is it Ok to do this

?Debug
Import brl.standardIO
?
..
..
..
?Debug
stuff
Print Stuff
?

I know I can do it, cos I am. But are there any pitfalls I should be aware of.


grable(Posted 2007) [#2]
But are there any pitfalls I should be aware of.

Not realy, the compiler/linker should complain if you messed up anyway.


SculptureOfSoul(Posted 2007) [#3]
If you are just using the ?debug command as a hack of sorts to provide conditional compilation based on something other than a debug build (i.e. you might use it to prevent compilation of some full version code in a demo version release) I think you can wrap the ?debug commands in an If.

e.g.:


if( SomeConstant = "DemoVersion" )
?debug
 //code you conditionally don't want compiled here
?
endif




H&K(Posted 2007) [#4]
I think you can wrap the ?debug commands in an If
What.

I dont think that the code you posted would work the way you expect. The ? is a pre-comiler command, it doesnt get looked at or not looked at depending on if the IF is true or not. If you set SomeConstant to <> "DemoVerion" or = "DemoVersion" the bit between ?Debug and ? is compiled depending on if its a debug build or not, and has no baring on the if.


SculptureOfSoul(Posted 2007) [#5]
Bah - yeah, you're right. I've been away from Blitz too long and starting to think of every problem in terms of Lisp. My bad. :(