<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Solved:</DIV>
<DIV> </DIV>
<DIV>
<DIV>The solution required one little line fixed:</DIV>
<DIV> </DIV>
<DIV></DIV>
<DIV>{ifopt b+}</DIV>
<DIV> </DIV>
<DIV></DIV>
<DIV>Anyway I have improved the test program somewhat, because it was a bit
shitty, it's still a little bit shitty but not as shitty ! ;) =D</DIV>
<DIV> </DIV>
<DIV>// *** Begin of Test Program ***</DIV>
<DIV> </DIV>
<DIV>program TestProgram;</DIV>
<DIV> </DIV>
<DIV>{$APPTYPE CONSOLE}</DIV>
<DIV> </DIV>
<DIV>{</DIV>
<DIV> </DIV>
<DIV>Test complete boolean evaluation compiler switches to see if they<BR>are
unit/file width or per routine or per code section</DIV>
<DIV> </DIV>
<DIV>version 0.01 created on 14 june 2011 and fixed/improved on 15 june 2011 by
Skybuck Flying</DIV>
<DIV> </DIV>
<DIV>Conclusion: it works per code section however there is a potential
problem:</DIV>
<DIV> </DIV>
<DIV>It might not be possible to return to the "default settings" ?!?</DIV>
<DIV> </DIV>
<DIV>For example once B+ is done all code below it will be effected ?!?<BR>B-
might then turn it off... but what if project default was on ?!?</DIV>
<DIV> </DIV>
<DIV>Perhaps it can be solved with $if or so... and some kind of
storage...</DIV>
<DIV> </DIV>
<DIV>It's fucked up/abortion-ed ;) I don't think it's possible so for now<BR>I
will have to stick with B+ down below the code sections ;)</DIV>
<DIV> </DIV>
<DIV>Ok solved,</DIV>
<DIV> </DIV>
<DIV>Solution is to use:</DIV>
<DIV> </DIV>
<DIV> $ifopt b+</DIV>
<DIV> </DIV>
<DIV>Thanks to "Bart" on usenet for providing this solution, he usefull after
all ! ;) =D</DIV>
<DIV> </DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>uses<BR> SysUtils;</DIV>
<DIV> </DIV>
<DIV>function Function1 : boolean;<BR>begin<BR>writeln('function1 called,
result: true');<BR>result := true;<BR>end;</DIV>
<DIV> </DIV>
<DIV>function Function2 : boolean;<BR>begin<BR>writeln('function2 called,
result: false');<BR>result := false;<BR>end;</DIV>
<DIV> </DIV>
<DIV>function Function3 : boolean;<BR>begin<BR>writeln('function3 called,
result: true');<BR>result := false;<BR>end;</DIV>
<DIV> </DIV>
<DIV>// default result: function3 not called, pretty bad.<BR>procedure
TestRoutine1;<BR>var<BR>vResult : boolean;<BR>begin<BR>writeln('TestRoutine1 -
DEFAULT - BEGIN');<BR>vResult := true;<BR>vResult := vResult and
Function1;<BR>vResult := vResult and Function2;<BR>vResult := vResult and
Function3;<BR>writeln('TestRoutine1 vResult: ', vResult
);<BR>writeln('TestRoutine1 - DEFAULT - END');<BR>writeln;<BR>end;</DIV>
<DIV> </DIV>
<DIV>procedure TestRoutine2;<BR>var<BR>vResult : boolean;<BR>begin</DIV>
<DIV> </DIV>
<DIV>{$ifopt b+}<BR> {$define CompleteBooleanEvaluationWasOn }<BR>
writeln('Default for Complete Boolean Evaluation is On.');<BR>{$else}<BR>
{$define CompleteBooleanEvaluationWasOff}<BR> writeln('Default for
Complete Boolean Evaluation is Off.');<BR>{$endif}<BR>writeln;</DIV>
<DIV> </DIV>
<DIV>{$BOOLEVAL ON}<BR>writeln('TestRoutine2 - BOOLEVAL ON - BEGIN');<BR>vResult
:= true;<BR>vResult := vResult and Function1;<BR>vResult := vResult and
Function2;<BR>vResult := vResult and Function3;<BR>writeln('TestRoutine2
vResult: ', vResult );<BR>writeln('TestRoutine2 - BOOLEVAL OFF -
END');<BR>writeln;<BR>{$BOOLEVAL OFF}</DIV>
<DIV> </DIV>
<DIV>writeln('TestRoutine2 - CONTINUATION - BEGIN');<BR>vResult :=
true;<BR>vResult := vResult and Function1;<BR>vResult := vResult and Function2;
// off works... so it's code specific ok nice. however what will happen outside
of code... will it go to default ?!?<BR>vResult := vResult and
Function3;<BR>writeln('TestRoutine2 vResult: ', vResult
);<BR>writeln('TestRoutine2 - CONTINUATION - END');<BR>writeln;</DIV>
<DIV> </DIV>
<DIV>{$if Defined(CompleteBooleanEvaluationWasOn)}<BR> writeln('Falling
back to Default Complete Boolean Evaluation which was On.');<BR>
{$BOOLEVAL ON}<BR>{$ifend}</DIV>
<DIV> </DIV>
<DIV>{$if Defined(CompleteBooleanEvaluationWasOff)}<BR> writeln('Falling
back to Default Complete Boolean Evaluation which was Off.');<BR>
{$BOOLEVAL OFF}<BR>{$ifend}<BR>writeln;</DIV>
<DIV> </DIV>
<DIV>writeln('TestRoutine2 - BOOLEVAL DEFAULT');<BR>vResult := true;<BR>vResult
:= vResult and Function1;<BR>vResult := vResult and Function2; // off works...
so it's code specific ok nice. however what will happen outside of code... will
it go to default ?!?<BR>vResult := vResult and
Function3;<BR>writeln('TestRoutine2 vResult: ', vResult
);<BR>writeln('TestRoutine2 - BOOLEVAL DEFAULT');<BR>writeln;</DIV>
<DIV> </DIV>
<DIV>end;</DIV>
<DIV> </DIV>
<DIV>// little problem... booleval remains on... and now we don't know what the
default behaviour was ?!?<BR>// it's desireable to fall back to default
behaviour for the rest of the code ?!?<BR>// problem solved.<BR>procedure
TestRoutine3;<BR>var<BR>vResult : boolean;<BR>begin<BR>writeln('TestRoutine3 -
OUTSIDE - BEGIN');<BR>vResult := true;<BR>vResult := vResult and
Function1;<BR>vResult := vResult and Function2;<BR>vResult := vResult and
Function3;<BR>writeln('TestRoutine3 vResult: ', vResult
);<BR>writeln('TestRoutine3 - OUTSIDE - END');<BR>writeln;<BR>end;</DIV>
<DIV> </DIV>
<DIV><BR>procedure Main;<BR>begin<BR>writeln('program started');</DIV>
<DIV> </DIV>
<DIV>TestRoutine1;<BR>TestRoutine2;<BR>TestRoutine3;</DIV>
<DIV> </DIV>
<DIV>writeln('program finished');<BR>end;</DIV>
<DIV> </DIV>
<DIV><BR>begin<BR> try<BR>Main;<BR> except<BR>on E: Exception
do<BR> Writeln(E.ClassName, ': ', E.Message);<BR>
end;<BR> ReadLn;<BR>end.<BR></DIV>
<DIV>// *** End of Test Program ***</DIV>
<DIV> </DIV>
<DIV>Bye,</DIV>
<DIV> Skybuck.</DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none"> </DIV></DIV></DIV></BODY></HTML>