Page 1 of 1
Compiler variables.
Posted: Fri Feb 13, 2009 7:40 am
by bokkie
Attached code snippet shows some code that's puzzling me:
[compiler if Variable MYCOMPILERVARIABLE is Defined ]
MessageBox: My compiler variable..., ...is defined.
[compiler end]
I've defined a compiler variable in the Project Options. If I set a breakpoint on the [compiler if...] statement it seems to step
on to the MessageBox but it displays nothing.
If, however, I change the code to:
[compiler if Variable MYCOMPILERVARIABLE Equals 1234567890]
MessageBox: My compiler variable..., #MYCOMPILERVARIABLE#
[compiler end]
It steps on to the MessageBox and it displays the value correctly.
My question is this: Should the "is defined" work if the compiler variable is defined (which it is) regardless if it has a value or not? Or am I misunderstanding what "is defined" means?

Re: Compiler variables.
Posted: Fri Feb 13, 2009 9:55 am
by StyX
EDIT: Ignore this.... All wrong
bokkie wrote:
[compiler if Variable MYCOMPILERVARIABLE is Defined ]
MessageBox: My compiler variable..., ...is defined.
[compiler end]
The IF check is not if that varible has been define, rather that the value of MYCOMPILERVARIABLE == Defined
Re: Compiler variables.
Posted: Fri Feb 13, 2009 10:14 am
by bokkie
StyX wrote:bokkie wrote:
[compiler if Variable MYCOMPILERVARIABLE is Defined ]
MessageBox: My compiler variable..., ...is defined.
[compiler end]
The IF check is not if that varible has been define, rather that the value of MYCOMPILERVARIABLE == Defined
Styx,
So
equals 1234567890 is the same as
is 1234567890?
Posted: Fri Feb 13, 2009 10:31 am
by StyX
Scratch that, I got ahead of myself. Didn't notice the IS in there.
Posted: Fri Feb 13, 2009 10:39 am
by bokkie
StyX wrote:Scratch that, I got ahead of myself. Didn't notice the IS in there.
You're not getting out of it so easily...

Posted: Fri Feb 13, 2009 10:43 am
by StyX
Did a little bit of testing and to me it seems that the is defined check doesn't work at all.
Tried with just adding the variable without any value, with a value and not having a added it at all. And in all cases it doesn't seem to me like the code inside it is actually executed :-S
Posted: Fri Feb 13, 2009 10:59 am
by bokkie
StyX wrote:Did a little bit of testing and to me it seems that the is defined check doesn't work at all.
Tried with just adding the variable without any value, with a value and not having a added it at all. And in all cases it doesn't seem to me like the code inside it is actually executed :-S
That was my observation as well. Time for Michael to step in and put us both out of our misery.

Posted: Fri Feb 13, 2009 12:59 pm
by MichaelNesmith
I have confirmed with R&D that the last two options in the drop down on the Compiler Variable If dialog are currently not available for compiler variables. Sorry about this bug...
These do work well in the If dialog of course.
Posted: Sat Feb 14, 2009 5:54 am
by bokkie
I will probably not use compiler variables that often but it's nice to see that you control them from one project options dialog.
I hate it when things can only join up unless you scatter the options in multiple hard to get at places which has been my experience with another product.
