How to? Shortcut evaluation

#5
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.
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.

When I come across a compound test such as in the OP, where the result of one of the tests determines whether or not a second test can be validly performed, I use nested IF/IFF tests; and I may need to perform Boolean manipulations to get them in the proper order. Auxiliary variables may be need, too.

unset x
if isfile abc if not %@filesize[abc] GT 12345 set x=no
iff not defined x then ...

It is more complicated than in some other programming languages, but it's all that can be done...
 
May 31, 2008
382
2
#6
not exactly what the OP asked for, but here's another idea, using do/leave as a glorified goto
Code:
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