View previous topic :: View next topic
|
Author |
Message |
abhishek mitra
New User
Joined: 24 Feb 2008 Posts: 48 Location: Kolkata
|
|
|
|
hi,
I am new to REXX.
Actually I am struggling with putting an OR condition in my code. though I followed the IBM matrial but probably I am too novice to locate the syntax error.
what I wrote is --
SAY 'ENETER THE CURRENT MONTH '
PULL MM
IF ((MM=12)|(MM=01)|(MM=02))
SAY 'WINTER'
ELSE
SAY 'SUMMER'
While executing I am getting an error
4 +++ IF ((MM=12):
IRX0013I Error running TEST, line 4: Invalid character in program
***
Can somebody plz guide in this? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
the or symbols has always been a pain in the ***
it depends on Your terminal char mapping,
try using the exclamation mark |
|
Back to top |
|
|
abhishek mitra
New User
Joined: 24 Feb 2008 Posts: 48 Location: Kolkata
|
|
|
|
Thanks , thanks, thanks.. a ton.
I have lost almost 2 days behind this |
|
Back to top |
|
|
abhishek mitra
New User
Joined: 24 Feb 2008 Posts: 48 Location: Kolkata
|
|
|
|
Hi !!
I need one more help.
while using WHEN - OTHERWISE statements if a condition happens where
for two or more values of a var i need to do the same action the how to write the code.
I mean --
WHEN X = 1 OR 2 OR 3
dO action
OTHERWISE
NOP
...
i am not getting this in the manual. I have tried the way we do in COBOL but that is not working.
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
You must use single compares
Code: |
when a = 1 <or>
b = 2 ...... |
or for a string comparison on a list
instead of
Code: |
when a = "wwww" <or>
a = "xxx" <or>
a = "zzzzzzz" ......
|
I often use the wordpos
Code: |
when wordpos(a,"wwww xxx zzzzzz") > 0 then ....
...... |
|
|
Back to top |
|
|
|