In this case, the expressions are evaluated in turn from left to right, and if the result of any evaluation is 1 then the test has succeeded and the instruction following the associated then clause is executed. If all the expressions evaluate to 0 and an else was given then the instruction after the else is executed.

Note that once an _expression_ evaluation has resulted in 1, no further expressions in the clause are evaluated. So, for example, in:

   -- assume 'name' is a string 
   if name=null, name='' then say 'Empty'

then if name does not refer to an object it will compare equal to null and the say instruction will be executed without evaluating the second _expression_ in the if clause.

How does that break compatibility with Rexx?

In ooRexx ot seems to be the other way round

If one exprexxion fails /results in 0/ the reat is ignored

Parse Version v
Say v
If a(), b() Then
Say 'ok'
Else
Say 'Else'
Exit
a:
Say 'A'
Return 0
b:
Say 'B'
Return 1


E:\>rexx ab
REXX-ooRexx_5.0.0(MT)_64-bit 6.05 10 Feb 2019
A
Else

so the commas are ands with shortcut

Rony's notation seems clear/er/  &,  and |,

Greetinga

Walter

_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to