ARexx rx question 
Author Message
 ARexx rx question

Quote:

>Why not just put in the program

> parse arg x y z               or      parse arg x ',' y ',' z

>and on the command line

> prog foo bar bletch                   prog foo,bar,bletch

>and in the call instruction

> call function 'string' var (expr)     call function 'string,'var','(expr)

Because it won't work all of the time, that's why. But it
can work just enough of the time to fool you. See Cowlishaw "Rexx Lang."
second edition, page 43 "The CALL Instruction" and page 125 "Parsing
Multiple Strings" (The same text appears in all IBM-published "VM REXX
Reference" manuals.)

CMS COMMAND: prog foo bar bletch   OR
REXX INSTRUCTION: call prog foo bar bletch OR x=prog(foo bar bletch)
     results in ONE string being passed: 'foo bar bletch'.
parse arg x y z .   <---- NOTE important dot at end !!! avoid 'bletch   '
     will, as expected, result in x='foo' y='bar' z='bletch'

CMS COMMAND: prog foo,bar,bletch     OR
REXX INSTRUCTION: call prog foo','bar','bletch   OR
                  x=prog(foo','bar','bletch)
     results in ONE string being passed: 'foo,bar,bletch'.
parse arg x ',' y ',' z .
     will, also as expected, result in x='foo' y='bar' z='bletch'

REXX INSTRUCTION: call prog foo,bar,bletch OR x=prog(foo,bar,bletch)
     results in *THREE* strings being passed: 'foo','bar', and 'bletch'
     (or whatever their values were, if they were defined REXX variables)
parse arg x y z .
     will result in x='foo' y=<null string> z=<null string>
parse arg x ',' y ',' z .
     will *ALSO* result in x='foo' y=<null string> z=<null string>
parse arg x, y, z .
     will result in x='foo' y='bar' z='bletch' - as likely intended.
     (or whatever their values were, if they were defined REXX variables)

Roger Deschner, University of Illinois at Chicago



Sat, 01 Oct 1994 20:26:29 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ARexx rx question

2. AREXX: rx named address

3. OREXX vs PCDOS 7 REXX and RX*.RX util

4. ARexx port <-> ARexx port

5. Questions to Dr. Rx

6. ARexx question

7. ARexx question

8. AREXX legal question

9. Questions about ARexx Systems Library

10. Further to my Arexx question;

11. ARexx Questions

12. AREXX error trapping question

 

 
Powered by phpBB® Forum Software