View previous topic :: View next topic
|
Author |
Message |
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
I have a loop, where I'm asking the user 3 questions, which he has to answer. Two answers are being asked at top of loop and third one at end of loop.
When it's entering the loop for first time, it's asking two question but then it is not waiting for the third answer to be entered and then loop goes infinite without asking any question (not even the first two).
What might be the error? |
|
Back to top |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Hi Tushar,
Can you post the code
Thanks
Sai |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
Hi All,
The code i am using is -
Code: |
USERCHOICE="N"
ENDOFLOOP="N"
DO WHILE ENDOFLOOP="N"
SAY 'ENTER THE PDS NAME(IF BASELINE DONT ENTER ANYTHING)'
PULL PDS
PDSLIB = STRIP(PDS,B," ")
IF PDSLIB=" " THEN
PDSLIB=CHGMAN.CARD.DBRMLIB
ELSE NOP
SAY 'ENTER THE MEMBER NAME'
PULL USERMEM
MEMBER = STRIP(USERMEM,B," ")
QUEUE "//"USERRACF"J JOB (@),'BIND BQ150',CLASS=0,MSGCLASS=R,"
QUEUE "// NOTIFY=&SYSUID"
.........
.........
QUEUE "//*"
IF USERCOND="Y" THEN
ENDOFLOOP="Y"
ELSE NOP
SAY "DO YOU WANT TO ENTER MORE MEMBER"
PULL CHOICE
USERCOND = STRIP(CHOICE,B," ")
END
|
|
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
maybe I'm wrong but at first sight you are asking for a field wich the user has not entered yet:
First:
Code: |
IF USERCOND="Y" THEN
ENDOFLOOP="Y"
ELSE NOP
|
Second:
Code: |
SAY "DO YOU WANT TO ENTER MORE MEMBER"
PULL CHOICE
USERCOND = STRIP(CHOICE,B," ") |
|
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
Hi,
Probably that might be the case.
But whatif i initialize the variable.
Secondly, I went for that because, if user wants to run the loop 4 times, the loop should execute 5 times, thats the reason i went for choice,usercond and end of loop. Is there any simplest way of achieving it.
Laslty, how easier it is to code a panel then use it in program.Actually this program takes input from user quite a few times, so i thought why not use panels/screen but the problem is i haven't use panels till now and i don't have that much time, i have to finish it within 2 days so how easier it is to code panle and use it. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Panels are quite easy to design and use.
In your case, maybe one panel with up to 15 entries for one display |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
It's because of the QUEUE statements. You're entering data into the same stack that you're trying to use for the prompt responses. Try holding that information in a stem variable until you're ready to use it. |
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
Hi Kevin,
Can you please be more elaborate on your answer.......i mean.......does the pull verb put the prompt into the same stack which the queue is using...........or whenever rexx finds a pull it searches the stack and that is when it waits but in this case since stack already has values the interpreter doesn't wait and takes it up from stack......
and last what is the solution should i put the queue in stem or the prompt into stem.
Regards,
Tushar |
|
Back to top |
|
|
|