| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: REXX |
Parlando con Andrea Zaccagnini a proposito di REXX,
Phil Crown scrisse:
PC> I am just learning REXX, but you should probably be using == not =?
PC> /**/
PC> a = 1
PC> aa = 2
PC> b = 3
PC> bb = 3
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
Awful: I just tested this code, and works fine! Where have you read about
the need for the == operator?
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
PC> arghh! :-)
That's funny, really. As far as I know
say "b =" b "bb ="bb
must return:
b =(value of b)bb =(value of bb)
The other token,
say "b ="b"bb ="bb
should give exactly the same output, because:
start quoting SAA Procedure Language REXX Reference, by W.D.Ashely:
___________________________________________________________________
o Concatenation
|| concatenate (with no blank in between)
(juxtaposition)concatenate (with no blank in between)
(blanks) concatenate with just one blank between
Examples:
myvar1 = "the"
myvar2 = " time"
say "Now" "is
"myvar||myvar2" for all good men ..."
ÀÄÂÄÙ À´ ÃÙ À´
³ ÀÄÄÄ¿
(blanks) ³ (||)
(juxtaposition)
(juxtaposition)
displays:
"Now is the time for all good men ..."
___________________________________________________________________
stop quoting
But that's the surprising result of some variations on this theme:
say "b =" b "bb ="bb
b = B bb =BB
................................................ REXXTRY.CMD on OS/2
say "b ="b"bb ="bb
Oooops ! ... try again. Invalid hexadecimal or binary string
rc = 15 ........................................ REXXTRY.CMD on OS/2
say "b ="||b||"bb ="||bb
b =Bbb =BB
................................................ REXXTRY.CMD on OS/2
say "b ="b"bb ="||bb
Oooops ! ... try again. Invalid hexadecimal or binary string
rc = 15 ........................................ REXXTRY.CMD on OS/2
say "b ="b||"bb ="bb
Oooops ! ... try again. Invalid hexadecimal or binary string
rc = 15 ........................................ REXXTRY.CMD on OS/2
say "b ="||b||"bb ="bb
b =Bbb =BB
................................................ REXXTRY.CMD on OS/2
say "b ="||b"bb ="bb
b =Bbb =BB
................................................ REXXTRY.CMD on OS/2
say "b ="||b"bb ="bb
^^
This is, out of every doubt, the critical concatenation. It seems that
an implicit concatenation in this position causes a wrong interpretation
of the token by REXX. And I've never heard or read about it before...
It seems a bug...
Bye,
Andrea Zaccagnini
... "And I Thyresias I have presuffered all" (Eliot)
---
* Origin: "Niente per caso" BBS - 050 52.53.39 - 24h/24 - {at} (2:332/617)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: 332/617 417 403 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™.