By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!I presume what you mean is to evaluate a logical expression left-to-right, and STOP when the result is known? AFAIK that would require a major redesign of the parser.Is there any way to achieve shortcut evaluation of logical expressions?
E.g. iff not isfile abc .or. %@filesize[abc] gt 12345 then...
runs into an error if file "abc" doesn't exist.
Is there any way to achieve shortcut evaluation of logical expressions?
Excluding the .XOR. operator, wouldn't reversing the result of a test already performed require that it be within parentheses? But I see the other major parsing issue: IIRC variable expansion is performed before anything else, thus in the OP's example the attempt to evaluate %@fileage[abc] would fail before the "isfile abc" test is performed.Not really feasible unless I remove support for the boolean operations, as the parser can't tell whether you might reverse the condition somewhere later in the evaluation.
do 1
if %a == %b .and. %c == %d leave
if %e != 32 .or. %f == A leave
iff %something% then
...
leave
endiff
gosub WHEN_ALL_CONDITIONS_FAIL
enddo