TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Phil Crown
from: Mike Tripp
date: 1995-10-30 14:03:52
subject: REXX

Hello Phil!

29 Oct 95 13:52, Phil Crown wrote to Andrea Zaccagnini:

 AZ>> Awful: I just tested this code, and works fine! Where have
 AZ>> you read about the need for the == operator?

 PC> Just from practicing, the same thing applies in C.

 PC>   =  is an assignment,
 PC>   == checks for equality.

= also functions as a string comparison operator in Rexx.  The difference
between = and == is that = will ignore leading/trailing blanks while ==
requires strict equality. So:

' test' = 'test ' is true.
' test' == 'test ' is false.

== also forces a string comparison w/numeric data, so:

0 = 0.0 is true.
0 == 0.0 is false.

 PC> However, the | and || seem to a bit different in Rexx than in C,
 PC> though I haven't figured out how exactly yet.

| is the logical OR operator and expects boolean arguments, while ||
performs string concatenation. So:

' test' || 'test ' is ' testtest '
and ' test' | 'test ' generates an error in an assignment statement since
Rexx doesn't interpret the strings as boolean values.

Both SAY and REXXTRY do strange (to me, anyway) things when parsing strings
that combine string data and the results of operations that need to be
interpreted on the fly and are not reliable indications of how the data is
interpreted internally by REXX itself when the same operations are
performed as a separate assignment. Oh well, this is price we have to pay
for the convenience of untyped data...strange/incorrect interpretations in
type-specific situations.

.\\ike

--- GoldED/2 2.42.G0615
* Origin: -=[ TechKnowledgy at Work ]=- (1:382/61.1)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 382/61 92 3615/50 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.