home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / rexx / 714 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.6 KB  |  62 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!NUSVM.BITNET!CCENGNM
  3. Message-ID: <CCENGNM.920814.130948.C0@NUSVM.BITNET>
  4. Newsgroups: comp.lang.rexx
  5. Date:         Fri, 14 Aug 1992 01:21:29 -0400
  6. Sender:       REXX Programming discussion list <REXXLIST@UGA.BITNET>
  7. From:         Anthony Ng <CCENGNM@NUSVM.BITNET>
  8. Subject:      Re: Stem vars as arguments?
  9. In-Reply-To:  JAY@WVNVM.WVNET.EDU message of Thu, 13 Aug 1992 16:54:02 EDT
  10. Lines: 50
  11.  
  12. >From:         James Justice <JAY@WVNVM.WVNET.EDU>
  13. >Subject:      Re: Stem vars as arguments?
  14. >
  15. >REXX does allow a stem to be EXPOSED.
  16. >
  17. >---Cut and Paste ---
  18. >/**/
  19. >t.1 = '1'
  20. >t.2 = '2'
  21. >t.3 = '3'
  22. >Call tryit
  23. >
  24. >Exit
  25.  
  26. >tryit: Procedure EXPOSE t.
  27. >Say t.1 t.2 t.3
  28. >Return
  29. >
  30. >This works with "1 2 3" being printed out!
  31.  
  32. Also, the procedure can alter the stem content:
  33.  
  34. op.0=3; op.1='a'; op.2='b'; op.3='c'
  35. call try1
  36. call try2
  37. say op.0 op.1 op.2 op.3 op.4
  38. exit
  39.  
  40. try1: procedure expose op.
  41.   say op.0 op.1 op.2 op.3
  42.   op.0=4; op.2='e'; op.4='d'
  43.   return
  44.  
  45. try2: procedure expose op.
  46.   say op.0 op.1 op.2 op.3 op.4
  47.   op.0=2; op.1='x'; op.2='y'
  48.   return
  49.  
  50. should gives you:
  51.     3 a b c
  52.     4 a e c d
  53.     2 x y c d
  54.  
  55. ---------
  56. *****************************************************************
  57. * Anthony Ng                        * "Don't Look Back !"       *
  58. * Systems Programmer                *      Luke 9:62            *
  59. * NATIONAL UNIVERSITY OF SINGAPORE  * "Batteries NOT included,  *
  60. * Bitnet : CCENGNM@NUSVM            *  neither any guarantte."  *
  61. *****************************************************************
  62.