View previous topic :: View next topic |
Author |
Message |
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Tue Sep 20, 2005 2:02 am Post subject: Passing STEM variable as argument in REXX |
|
|
Hi
I am calling one REXX program from another one.
Can I pass STEM variable as an argument to the called program.
I have a variable as follows in my calling program...
name.0 = 3
name.1 = "Sri"
name.2 = "Raj"
name.3 = "Rams"
I need to pass all the names to called program as argument.
Will "CALL PGM2(NAME.)" statment will do the purpose?
How should I receive the same in the called program.
Thanks for the help...
Sridhar P |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue Sep 20, 2005 2:23 am Post subject: |
|
|
In the called program Arg() will give you the number of arguments, you could play with it.
Code: |
do i=1 to Arg()
yourstem.i = arg(i)
end i
|
hth. |
|
Back to top |
|
|
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Tue Sep 20, 2005 2:36 am Post subject: |
|
|
Hi
But I dont know the format - how to pass a STEM variable as argument to a called program and how should I receive the same in called program.
Thanks
Sridhar P |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue Sep 20, 2005 3:16 am Post subject: |
|
|
several ways:
-writing/reading a file
-using the stack (queue in call-er /pull in call-ed)
-using arguments:
address tso "AAA" arg1 arg2
parse value AAA(arg1 arg2) with RC fieldback1 fieldback2...
x=AAA(arg1 arg2) |
|
Back to top |
|
|
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Tue Sep 20, 2005 3:41 am Post subject: |
|
|
I know these options...
What I want to know is...
Is there a way that I pass the stem variable as an argument to the called program like
CALL CALLEDPGM(NAME.)
where
NAME.0 = 3
NAME.1 = "Sri"
NAME.2 = "Raj"
NAME.3 = "Rams"
and receive the same in the called program using ARG NAME. |
|
Back to top |
|
|
acevedo Beginner
Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue Sep 20, 2005 4:30 am Post subject: |
|
|
oooooooop sorry.
I don't know, I just treat it every item as a single argument. |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Tue Sep 20, 2005 4:46 am Post subject: |
|
|
psridhar, I think the best plan is just to try it.
Cheers,
Merv _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
|
|