View previous topic :: View next topic
|
Author |
Message |
Andi1982
New User
Joined: 27 Mar 2008 Posts: 42 Location: Karlsruhe / Germany
|
|
|
|
Hey,
I have a REXX that reads LISTFILE into program stack. So there are 1000 items in the stack and I am iterating and pulling from it until it is empty. But now i have some items where I need user feedback. So I tried to do
Code: |
Say 'You need to keep this file?' filename
pull answer
...
|
But instead of reading user Input from Terminal it takes the next item from the program stack. How can I force to read user Input from terminal even that there are items in program stack?
Best regards
Andi[/code] |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
just read the stack into a stem . |
|
Back to top |
|
|
Andi1982
New User
Joined: 27 Mar 2008 Posts: 42 Location: Karlsruhe / Germany
|
|
|
|
You mean i should read all stack into stem and then push it back after i got my input? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why would You want to push it back ...
just process the stem |
|
Back to top |
|
|
Andi1982
New User
Joined: 27 Mar 2008 Posts: 42 Location: Karlsruhe / Germany
|
|
|
|
you are right ... sometimes it can be that easy...
thank you a lot for this hint! |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2023 Location: USA
|
|
|
|
Optionally manipulate with stack levels:
Code: |
"NEWSTACK" /* optional; program stack for input records */
"EXECIO * DISKR INPUTDD (FINIS"
Do iRec = 1 by 1 While Queued() > 0
[Parse] Pull NewRecord
If NeedToAskUser Then Do
"NEWSTACK" /* new program stack to isolate user's answer */
Say 'You need to keep this file?' filename
pull answer
"DELSTACK" /* return to previous stack level, to continue with data */
End
End iRec
"DELSTACK" /* optional; clean-up after reading file */
|
|
|
Back to top |
|
|
|