Using variables for the tail

"REXX treats the case used for stem variables and any variables used within the tail of compound variables differently. Stem variables (up to the first period) are uppercased like any simple variable in REXX. The contents of the tail are processed in the case written."

See the following example:

 
/* */

 tail1 = 'abcd'
 tail2 = 'ABCD'

 myStem.abcd = 1
 say myStem.tail1       /* prints "MYSTEM.abcd"                       */
 say myStem.tail2       /* prints "1"                                 */

You can use any character for the names of tails:

 
/* */

  possibleTail1 = XRANGE( "00"x, "7F"x )
  possibleTail2 = XRANGE( "80"x, "FF"x )

  myStem.possibleTail1 = 111
  myStem.possibleTail2 = 222

  say myStem.possibleTail1      /* prints "111"                       */
  say myStem.possibleTail2      /* prints "222"                       */

(see Sample for using compound variables for an example of using this feature;
see also Using variables for the stem)


[Back: Using variables for the stem]
[Next: Writing general routines for compound variables]