5 pts.
 How to pause execution of a macro to allow user input of variable data in iSeries
I am exploring the possibilities to speed up input when testing by taking advantage of macros. The problem is when variable data has to be keyed into a field in the middle of the sequence. Reading the help-topics on WAIT I thought I could use the WaitForCursor-option, but it does not change the system mode to allow manual input. The steps are as follows: autECLSession.autECLPS.SendKeys "001" ‘Branch code is filled autECLMacro "[edit-paste]" ‘Customer No is filled autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "[tab]" ‘cursor is sent to Currency field MsgBox "Key base currency code" ‘ Now I want the macro execution to pause until I have entered a currency code <<manual input of currency code. Upon completion, cursor automatically positions i the next field at 5,27>> ‘the cursor automatically has positioned in the Account Code field autECLSession.autECLPS.WaitForCursor 5,27,10000 ‘Macro now to resume autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "250101" Hope you can help with the missing part.

Software/Hardware used:
ASKED: November 13, 2008  12:27 PM
UPDATED: March 24, 2011  5:47 PM

Answer Wiki:
How about using two macros? One to get to the input point, and a second to continue? Not a very "techie" solution, but simple.
Last Wiki Answer Submitted:  November 25, 2008  3:29 pm  by  Vermonter   25 pts.
All Answer Wiki Contributors:  Vermonter   25 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

If you have access to TAATOOLS, check out PMTOPR command.
It is designed exactly for what you want.
We’ve used it for many years. Works great.

One really cool feature is that you can use the command to do some basic validation of the user’s response. For example, if your program asks the user to enter “Y” to proceed or “N” to stop. the command can require the user to enter Y or N, relieving you from writing validation logic in your program.

 5,525 pts.

 

Hey!
You can usethe InputBox function:

       Resposta = InputBox ("Message", "Caption","DefaultValue", xPos, yPos) 

Where:
[ol]
[li]Message (string): an explanation on what you want the user to type;[/li]
[li]Caption (string): the tile of the dialog;[/li]
[li]DefaultValue (Variant): the value will be displayed and assumed if the does not enter anything;[/li]
[li]xPos, xPos (integer): the coordinateds where to position the dialog;[/li][ol]
A dialog with an editing field will be showed waiting for the user to type something and click either the [ ok ] button or [ cancel ] button;
If the user click the cancel button the result of the function will be “” (null);
Example:

    Resposta = InputBox ("Currency:", "Systems automation Inc.","********", 100, 300) 

Obs: Passwords cannot be entered because the function always show the chars typed in.

 10 pts.