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

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!PSUHMC.BITNET!LWORSFOL
  3. Message-ID: <REXXLIST%92081208542115@OHSTVMA.IRCC.OHIO-STATE.EDU>
  4. Newsgroups: comp.lang.rexx
  5. Date:         Wed, 12 Aug 1992 08:42:39 EDT
  6. Sender:       REXX Programming discussion list <REXXLIST@UGA.BITNET>
  7. From:         "Lynne J. Worsfold" <LWORSFOL@PSUHMC.BITNET>
  8. Subject:      Re: Stem vars as arguments?
  9. In-Reply-To:  Message of Wed,
  10.               12 Aug 1992 03:53:49 GMT from <ednstras@KRAKEN.ITC.GU.EDU.AU>
  11. Lines: 64
  12.  
  13. On Wed, 12 Aug 1992 03:53:49 GMT Michael Strasser said:
  14. >I am writing a complicated REXX program under OS/2 2.0.  I would like to be
  15. >able to use a stem variable as an argument to an internal procedure, but my
  16. >attempts have failed so far.
  17. >
  18. >Here is a simple example:
  19. >
  20. >/* Init the stem var. */
  21. >Opts.Label = 'Select an option A-C, X'
  22. >Opts.0 = 4 /* No. options */
  23. >Opts.1 = 'A'
  24. >Opts.2 = 'B'
  25. >Opts.3 = 'C'
  26. >Opts.4 = 'X'
  27. >
  28. >Choice = GetChoice(Opts)
  29. >
  30. >/* ... */
  31. >
  32. >GetChoice: PROCEDURE
  33. >ARG Stem  /* Stem var with options */
  34. >
  35. >SAY Stem.Label
  36. >PULL Resp
  37. >FOR i = 1 TO Stem.0 DO
  38. >    IF Resp = Stem.i THEN
  39. >        LEAVE
  40. >END /* i */
  41. >
  42. >IF i = Stem.0 + 1 THEN /* Default is Stem.1 */
  43. >    RETURN Stem.1
  44. >
  45. >RETURN Stem.i
  46. >
  47. >/* End of example */
  48. >
  49. >This doesn't work.  Nor does GetChoice(Opts.) or GetChoice('Opts') or
  50. >GetChoice('Opts.').
  51. >
  52. >Is there any way to do what I want?
  53. >
  54. >Any help would be greatly appreciated.
  55. >
  56. >--
  57. >Mike Strasser                       Internet: M.Strasser@edn.gu.edu.au.
  58. >Education Division                  Fidonet:  3:640/308.2@fidonet
  59. >Griffith University
  60. >Brisbane, Australia
  61.  
  62.    I received the reply to this note that this is not possible under OS/2
  63. yet.  Is anything like this possible under CMS?  I have to declare over
  64. 100 stem variables in this Rexx program I am working on.  I would really
  65. like to have all those declare statements in another CMS file and Call
  66. that file from within the Main Rexx program.  Apparently the values of the
  67. stem variables in an external subroutine are not available to the main
  68. routine without passing those variables back somehow.  I am Very new
  69. at Rexx programming.  I would appreciate any help with this one!
  70.  
  71. -----------------------------------------------------------------------
  72. Lynne J. Worsfold                      Pennsylvania State University
  73. Project Leader/Information Systems     Milton S. Hershey Medical Center
  74. Internet: lworsfol@psuhmc.hmc.psu.edu  140 Sipe Ave
  75. Voice:    (717) 531-6278               Hershey, PA  17033
  76. -----------------------------------------------------------------------
  77.