TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Andrea Zaccagnini
from: Phil Crown
date: 1995-10-29 13:52:00
subject: REXX

-=> Quoting Andrea Zaccagnini to Phil Crown <=- 

 PC> if((a == aa) | (b == bb)) then
 PC> do
 PC> if(a == aa) then
 PC> say "a="a" aa="aa
 PC> if(b == bb) then
 PC> say "b =" b "bb ="bb
 PC> end

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

Just from practicing, the same thing applies in C.

  =  is an assignment,
  == checks for equality.

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

for example, in the following, the first example will not print anything
even if I hit 'y' or 'Y', but the second will.

/**/
  say 'Hit y';
  key = SysGetKey(Echo);

  if key == 'y' || key == 'Y' then
    say "key="key

  say 'Hit y';
  key = SysGetKey(Echo);

  if key == 'y' | key == 'Y' then
    say "key="key

  return 0;

 
 PC> Now, to add to the confusion, this line works,
 PC> say "b =" b "bb ="bb

 PC> but this one does not?
 PC> say "b ="b"bb ="bb
 
 AZ> say "b ="||b"bb ="bb
 AZ> ^^
 AZ> This is, out of every doubt, the critical concatenation. It seems that
 AZ> an implicit concatenation in this position causes a wrong
 AZ> interpretation of the token by REXX. And I've never heard or read about
 AZ> it before... It seems a bug...

Must be a bug.

phil.crown{at}bluecafe.com
___ Blue Wave/QWK v2.21b Beta

--- WILDMAIL!/WC v4.12 
* Origin: The Blues Cafe (214) 638-1186 8 Nodes (1:124/8014.0)
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: 124/8014 8043 1 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™.