OS/2 Procedures Language 2/REXX


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


REXX.CMD File Commands


In a REXX procedure, anything not recognized as an instruction, 
assignment, or label is considered a command.  The statement recognized as 
a command is treated as an expression.  The expression is evaluated first, 
then the result is passed to the operating system. 
The following example, COPYLIST.CMD, shows how a command is treated as an 
expression.  Note how the special character (*) is put in quotation marks. 
COPYLIST.CMD copies files from drive A to drive B. 

/* Issuing a command from a procedure.  This example copies  */
/* all files that have an extension of.LST from              */
/* drive A to drive B.                                       */
SAY
COPY "a:*.lst b:"           /* This statement is treated as  */
                            /* an expression.                */
                            /* The result is passed to OS/2. */
EXIT

Note:    In the preceding example, the whole OS/2 command except for COPY 
         is in quotation marks for the following reasons: 
   o  If the colon (:) were not in quotation marks, the REXXSAA 
      interpreter would treat a: and b: as labels. 
   o  If the asterisk (*) were not in quotation marks, the REXXSAA 
      interpreter would attempt to multiply the value of a: by .LST. 
   o  It is also acceptable to include the entire OS/2 command in 
      quotation marks so that "COPY a:*.LST b:" is displayed. 
 
   

Inf-HTML End Run - Successful