[comp.sys.amiga] Help with EXPOSE in ARexx requested

new@udel.edu (Darren New) (02/10/90)

I'm trying to write a somewhat generic menu handler in ARexx on the Amiga.
My Do_Menu.rexx file originally started with

/* do_menu */
Do_Menu:
   procedure
   parse arg a b
   blah blah
   if recurse; then call Do_Menu(a, b)

Now the recursion is required and thus some kind of procedure is required.
However, on first call from a separate file, "procedure" gives an error.
So I changed it to

/* do_menu */
signal enter
Do_Menu:
procedure
enter:
  blah blah

This seems to work.  However, I now want to expose some variables in order
that the results of the menu functions can have some effect on
the caller. Basically, the Do_Menu function reads and INTERPRETs strings
from a file.  I want INTERPRET to be able to change the values of
variables (as well as look at variables) from the caller.
The ideal mechanism would be passing in a string containing a list
of root symbols that would be exposed. I tried 
INTERPRET 'procedure expose' varlist
but that does not seem to work.

Any help here, no matter how kludgey, would be appriciated.  How do I
get to the caller's variables from a separate-file ARexx macro called from
ARexx?                     -- Darren

lphillips@lpami.wimsey.bc.ca (Larry Phillips) (02/10/90)

In <385@icebox.nsc.com>, waggoner@dtg.nsc.com (Mark Waggoner) writes:
>In article <10665@nigel.udel.EDU> new@udel.edu (Darren New) writes:
>>
>>Any help here, no matter how kludgey, would be appriciated.  How do I
>>get to the caller's variables from a separate-file ARexx macro called from
>>ARexx?                     -- Darren
>
>I don't believe you can expose variables that were initailized in a
>separate-file ARexx macro.  The ways that I can think of doing it
>would be to put the values you want to modify on the clip list or 
>to return a string from your procedure that contains rexx instructions
>to set the variable values.  The caller can then interpret the
>returned string to set the variable values.

Right. A few other ways...

Have the called macro send output to stdout, and when you call it, pipe the
output to execio (comes with WShell).

Have the called macro use QUEUE or PUSH to stack the variables, then read them
in the calling macro with PULL or with a file operation (READLN(), READCH() ),
using stdin as a file spec.

Have the called program send a message to the caller via PutMsg().

-larry

--
Gallium Arsenide is the technology of the future;
  always has been, always will be.
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+

waggoner@dtg.nsc.com (Mark Waggoner) (02/11/90)

In article <10665@nigel.udel.EDU> new@udel.edu (Darren New) writes:
>
>Any help here, no matter how kludgey, would be appriciated.  How do I
>get to the caller's variables from a separate-file ARexx macro called from
>ARexx?                     -- Darren

I don't believe you can expose variables that were initailized in a
separate-file ARexx macro.  The ways that I can think of doing it
would be to put the values you want to modify on the clip list or 
to return a string from your procedure that contains rexx instructions
to set the variable values.  The caller can then interpret the
returned string to set the variable values.

-- 
Mark Waggoner  Santa Clara, CA    (408) 721-6306         waggoner@dtg.nsc.com 
 Unofficially representing National Semiconductor Local Area Networks Group
                   Officially misrepresenting myself.