CREXX icon indicating copy to clipboard operation
CREXX copied to clipboard

problem with boolean

Open rvjansen opened this issue 3 years ago • 2 comments

options level
v=' 1 '                              
If v Then say 'this should NOT be ok'

String ' 1 ' (1 with spaces around it) should not evaluate to True. Testcase by Walter Pachl.

UPD: changed to 'discussion' as ooRexx does what VM Rexx does - but CRX ('the standard'), Regina and NetRexx conform to CREXX.

rvjansen avatar Jul 25 '22 12:07 rvjansen

Mmm ... I am not certain why ' 1 ' would not be converted to 1 and therefore to true ...

When you do a trace results with vm rexx or oorexx does it give a hint to the logic?

what does

say ' 1 ' + 2

do?

adesutherland avatar Jul 25 '22 13:07 adesutherland

I am wondering if it is a question of if the implicit comparison between ' 1 ' and '1' is strict or not-strict? The ansi standard seems silent on this - the only thing I have on page 83 is

The expression is evaluated. If the value is neither '0' nor '1' error 34.1 occurs.

Which kind of says that it is not-strict it should be true, and if it is strict it should be error 34.1??

adesutherland avatar Jul 25 '22 13:07 adesutherland

Won't "fix" for level b/g

adesutherland avatar Jun 22 '25 20:06 adesutherland