I have another question today.
I have Map. There is field called Duration.
The field can accept inputs based on the user access.
Assume user A and user B.
Requirement:
Case 1
If user A and duration > 30
Error message. Should not allow to to proceed furtner
Case2
If user B and duration >30 and <40> 40
Arror message. Should not allow to proceed further
I did case 1 and case 3 using Reinput *message. How can I address case 2. Using reinput is not allowing me to go further?
I just want avoind to use window+another Map. In worst case I will use both to display the message.
Your case 2 (only two are described, not 3) is not clear. Perhaps you could paste in the actual code.
If the REINPUT is not allowing you to go further, it would imply that your IF statement is true when you are expecting it to be false, so re-examine your boolean logic first.
To repeat what Douglas said; we have no Case 3. I am guessing that Case 2 is between 30 and 40 and Case 3 is greater than 40, but there is no “action” shown for case 2 or 3.
What is not clear at all is what you are trying to do. What do you mean by:
"Should not allow to proceed further "
Does this mean you will issue a STOP?
REINPUT returns to an INPUT statement (and optionally, via FULL), and waits for user input. Unless you change something, the IF (I presume) for cases 1,2, and 3, will still be true. You will be in a loop.
To repeat Douglas again, we need to see the relevant code; the INPUT, the IFs, and the REINPUTs.
Hi Douglas,
I did some changes and the message is working as alert. But this creates another problem.
Before my changes when the user was giving a value of less than 30, it was doing the calculations and showing the results on the screen. As the Reinput statement passes the control to the previous Input screen, it is not processing the statements after REINPUT statement. hence not doing the calculation. and showing the result. To see the results I am going back to previous screen and coming back.
I think Now I have to avoid the REINPUT statement and use the WINDOW to display the alert message. So that, I can execute the statements after alert message and see the result.
Thank you and Steve for your valuable time and suggestions in all my needy times. This is the very best place to improve my skills in Natura/Adabas world.
“Case 1
If user A and duration > 30
Error message. Should not allow to to proceed further”
What does this mean??
If I am user A, am I supposed to get a chance to “fix” duration? If so, I want to use REINPUT, perhaps with a counter/flag as Jerome said.
OR, do I accept the value >30, and continue with everything as if the value was less than 30, but also give the user an alert message that output may be wrong because the input value was “wrong”.
A REINPUT does indeed immediately return to the previous INPUT statement. As such, it is useful for error messages when you do not want to continue processing the screen’s contents until the error condition is rectified. The REINPUT will only update the specified areas of the screen (MARK option), so if your calculation result fields won’t be updated either unless you MARK them also. Using the INPUT/WITH TEXT might be simpler.
Could you write this out “longhand”; for example (probably wrong)
duration greater than 30 but not equal to 40
It is not clear from what you have written why REINPUT will not work for this case as well.
I understand Case 1. A simple IF test REINPUT. Nothing further happens unless the user enters a valid duration.
From what you have written, it is not clear why Case 2 is not similar to Case 1. Is there some value of duration for which you continue processing even though duration is greater than 30 in Case 2?
I am so sorry to confuse you all the time.
Let me take little time to explain my problem.
Whenever I write a long description, I find some text missing. So I have attached the text file with the details.