Skybuck Flying
2011-06-14 00:57:54 UTC
Hello,
I want to make sure that complete boolean evaluation for certain code
sections is on.
However after the code section I want the "complete boolean evaluation"
compiler switch state back to what it was/the default.
So I would like to write something like:
{$if BOOLEVAL = ON}
{$define CompleteBooleanEvaluationWasOn}
{$ifend}
{$if BOOLEVAL = OFF}
{$define CompleteBooleanEvaluationWasOff}
{$ifend}
{$BOOLEVAL ON}
... code section ...
{$if CompleteBooleanEvaluationWasOn}
{BOOLEVAL ON}
{$ifend}
{$if CompleteBooleanEvaluationWasOff}
{BOOLEVAL OFF}
{$ifend}
So I would like the rest of the code to be un-effected by my compiler switch
change just to make sure that everything else compiles as normal/default.
However it either doesn't seem to be possible to write it like this or I am
not good enough at writing conditional compiler directives.
Is it possible to solve it with compiler directives ?
If not then perhaps Delphi Compiler needs a "default" directive like so:
{$BOOLEVAL DEFAULT}
This would take the project options default value for this compiler
directive to solve the problem ! ;) =D
Bye,
Skybuck.
I want to make sure that complete boolean evaluation for certain code
sections is on.
However after the code section I want the "complete boolean evaluation"
compiler switch state back to what it was/the default.
So I would like to write something like:
{$if BOOLEVAL = ON}
{$define CompleteBooleanEvaluationWasOn}
{$ifend}
{$if BOOLEVAL = OFF}
{$define CompleteBooleanEvaluationWasOff}
{$ifend}
{$BOOLEVAL ON}
... code section ...
{$if CompleteBooleanEvaluationWasOn}
{BOOLEVAL ON}
{$ifend}
{$if CompleteBooleanEvaluationWasOff}
{BOOLEVAL OFF}
{$ifend}
So I would like the rest of the code to be un-effected by my compiler switch
change just to make sure that everything else compiles as normal/default.
However it either doesn't seem to be possible to write it like this or I am
not good enough at writing conditional compiler directives.
Is it possible to solve it with compiler directives ?
If not then perhaps Delphi Compiler needs a "default" directive like so:
{$BOOLEVAL DEFAULT}
This would take the project options default value for this compiler
directive to solve the problem ! ;) =D
Bye,
Skybuck.