View previous topic :: View next topic |
Author |
Message |
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Mon Apr 18, 2005 9:17 am Post subject: Arrays in REXX Panels |
|
|
Hi
I am designing a panel which will have 24 output fields. I will take input from field @PMESG and will go to database. I will get some rows and I have to show them in this panel. The number of fetched rows may be from 0 to any. I have to fill first 24 rows in the output variables and throw the panel. For that I used output variables as ME01, ME02.... ME24.
Can not I use indexed variable (arrays) for this output variables. Its very combusome in my rexx coding to fill or initialize these output variables.
Thanks in advance
Sridhar P
[code:1:f5b4f2c39b])BODY EXPAND(]])
$ PROMPT ASSIST FOR MESSAGE
$ +
$ +
$ + |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Apr 18, 2005 9:36 am Post subject: |
|
|
Psridhar,
why not use stem variables?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Mon Apr 18, 2005 9:48 am Post subject: |
|
|
Hi
Thank you very much for the answer.
If I say ME.1 as output variable in the panel, it says
"Variable 'ME.1' is syntactically incorrect."
Please help...
Regards
Sridhar P |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Mon Apr 18, 2005 10:02 am Post subject: |
|
|
Consider using the "interpret" command.
If you have a stem variable "me" and your panel variables are defined as ME1, ME2...ME24 then you can initialise them like this:
Code: |
do i = 1 to 24
interpret 'me.i = me'i
end
|
_________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Mon Apr 18, 2005 10:14 am Post subject: |
|
|
I got that back to front. The code above will copy the data from the panel variables to your stem variable. The code below will go the other way.
Code: |
do i = 1 to 24
interpret 'me'i' = me.i'
end
|
_________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Mon Apr 18, 2005 11:12 am Post subject: |
|
|
Hi
Thanks for the help... It works fine.
Sridhar P |
|
Back to top |
|
|
|
|