home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!paladin.american.edu!auvm!PSUHMC.BITNET!LWORSFOL
- Message-ID: <REXXLIST%92081208542115@OHSTVMA.IRCC.OHIO-STATE.EDU>
- Newsgroups: comp.lang.rexx
- Date: Wed, 12 Aug 1992 08:42:39 EDT
- Sender: REXX Programming discussion list <REXXLIST@UGA.BITNET>
- From: "Lynne J. Worsfold" <LWORSFOL@PSUHMC.BITNET>
- Subject: Re: Stem vars as arguments?
- In-Reply-To: Message of Wed,
- 12 Aug 1992 03:53:49 GMT from <ednstras@KRAKEN.ITC.GU.EDU.AU>
- Lines: 64
-
- On Wed, 12 Aug 1992 03:53:49 GMT Michael Strasser said:
- >I am writing a complicated REXX program under OS/2 2.0. I would like to be
- >able to use a stem variable as an argument to an internal procedure, but my
- >attempts have failed so far.
- >
- >Here is a simple example:
- >
- >/* Init the stem var. */
- >Opts.Label = 'Select an option A-C, X'
- >Opts.0 = 4 /* No. options */
- >Opts.1 = 'A'
- >Opts.2 = 'B'
- >Opts.3 = 'C'
- >Opts.4 = 'X'
- >
- >Choice = GetChoice(Opts)
- >
- >/* ... */
- >
- >GetChoice: PROCEDURE
- >ARG Stem /* Stem var with options */
- >
- >SAY Stem.Label
- >PULL Resp
- >FOR i = 1 TO Stem.0 DO
- > IF Resp = Stem.i THEN
- > LEAVE
- >END /* i */
- >
- >IF i = Stem.0 + 1 THEN /* Default is Stem.1 */
- > RETURN Stem.1
- >
- >RETURN Stem.i
- >
- >/* End of example */
- >
- >This doesn't work. Nor does GetChoice(Opts.) or GetChoice('Opts') or
- >GetChoice('Opts.').
- >
- >Is there any way to do what I want?
- >
- >Any help would be greatly appreciated.
- >
- >--
- >Mike Strasser Internet: M.Strasser@edn.gu.edu.au.
- >Education Division Fidonet: 3:640/308.2@fidonet
- >Griffith University
- >Brisbane, Australia
-
- I received the reply to this note that this is not possible under OS/2
- yet. Is anything like this possible under CMS? I have to declare over
- 100 stem variables in this Rexx program I am working on. I would really
- like to have all those declare statements in another CMS file and Call
- that file from within the Main Rexx program. Apparently the values of the
- stem variables in an external subroutine are not available to the main
- routine without passing those variables back somehow. I am Very new
- at Rexx programming. I would appreciate any help with this one!
-
- -----------------------------------------------------------------------
- Lynne J. Worsfold Pennsylvania State University
- Project Leader/Information Systems Milton S. Hershey Medical Center
- Internet: lworsfol@psuhmc.hmc.psu.edu 140 Sipe Ave
- Voice: (717) 531-6278 Hershey, PA 17033
- -----------------------------------------------------------------------
-