Why doesn't this work?
vining
Posts: 4,368
DEFINE_START nVST_DeBug = 0 ; // use to debug from start up! change to 0 when finished debugging! if (nVST_DeBug) // or comment out completely ! { #WARN 'nVST_DeBug is set to 1 in DEFINE_START' ; }
No matter what I change nVST_DeBug to I get the compiler warning, which is not what I expected!
Why?
0
Comments
Debug is on and will generate your warning ? at compile time
And to turn debug off and not have the warning generated you could do this:
HTH
I've found it simpler to use SEND_STRING 0 coupled with a regular variable (or virtual device channel). Precompiler directives are a bit kludgy for this kind of application, IMO.
DHawthorne wrote: I have a regular debug variable used through out the code as a conditon for enabling or disabling my SEND_STRING 0's which is the var nVST_DeBug. I just wanted a lazy mans way of starting debug at start up just so I can see all the initialization stuff that I would miss if I'm slow on the trigger. The #WARN was put there as a reminder that I set it in DEFINE_START and not by setting a variable or channel.