REXX Tips & Tricks, Version 2.80

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

Multiple assignments

You can use the PARSE instruction to assign one value to two or more 
variables in one statement. 

/* assign a value to more than one variable in one statement          */

  parse value directory() with 1 dirString1 1 dirString2
                        /* now dirString1 and dirString2 both contain */
                        /* the name of the current directory          */

  parse var sourceVar 1 targetVar1 1 targetVar2 1 targetVar3
                        /* now the variables targetVar1, targetVar2   */
                        /* and targetVar3 all contain the value of    */
                        /* sourceVar                                  */

(see also Get the current screen size for a working example)   

Inf-HTML End Run - Successful