View previous topic :: View next topic
|
Author |
Message |
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
Hi,
I need to check different values of a variable using WHEN conditions. and these values needs to behave as NOT equal,
Since it is NOT equal we needs to combine these values using AND condition (&), Correct?
If so is the below Rexx code correct,
when ((top \= 9) & (top \= W) & (top \= Y) & (top \= Z)) then do |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
What happened when you tried???? |
|
Back to top |
|
|
Sumeendar
New User
Joined: 31 Jan 2006 Posts: 39
|
|
|
|
I haven't tested it, as there are few constraints in doing so.
I just wanted to know whether the code which i have mentioned is correct or not.. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Sumeendar wrote: |
I haven't tested it, as there are few constraints in doing so.
|
Very weird constraints for not testing a REXX program which doesn't need any compilation I am sorry to say it is a lame excuse like saying "I forgot my id password so can't work today" |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Sumeendar wrote: |
If so is the below Rexx code correct,
when ((top \= 9) & (top \= W) & (top \= Y) & (top \= Z)) then do |
In REXX there are other (better?) ways to do that:
Code: |
/* if top is one of the 4 letters, pos will have a value of 1 to 4 */
/* if top does not contains one of the letters, pos will return 0 */
/* but will return false positive if top contains 9W or WY or YZ */
when Pos(top,'9WYZ') = 0 then do |
Code: |
/* quite similar, without the false positives */
when WordPos(top,'9 W Y Z') = 0 then do |
Can't run tests ? That's tough ! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I haven't tested it, as there are few constraints in doing so. |
Either you are quite lazy or you are not really interested in doing this kind of work.
If you can edit you code in tso/ispf, you can test. . .
Maybe not the entire process, but what you ask about can easily be tested with a tiny bit of code that is only for testing this particular requirement. |
|
Back to top |
|
|
|