[$variable = ]AskFor("prompt"[,password][,"defaultData"]
[,BackButton(label:)][,WindowPos(CENTER)])
[,WindowPos(CENTRE)]
[,WindowPos(DEFAULT)]
[,WindowPos(CURSOR)]
[,WindowPos(top,left[,PIXELS])]
[,WindowPos(row,col,ROWCOL)]
[,WindowPos(row,col,CURSOR)]
Where:
$variable |
an optional return variable. If a return variable is specified, the data the user types into the AskFor dialog box is assigned to this variable instead of typed on the screen. If the variable already contains data and no default data is specified on the AskFor command; the variable data appears as the default data in the edit box within the AskFor dialog box. |
prompt |
is text telling the user what to enter into the AskFor dialog box. |
password |
an optional keyword that indicates asterisks (*) are displayed rather than the text the user types into the AskFor dialog box. |
defaultData |
this text appears in the edit box within the AskFor dialog box. The user can accept this data by pressing enter or change it by typing over it. |
BackButton(label:) |
If this parameter is specified the "Paste" button on the AskFor prompt dialog box is replaced with a "Back" button. If the "Back" button is pressed, the script branches to the label specified in the parameter instead of processing the data in the AskFor dialog. |
WindowPos(CENTER) |
centers the AskFor dialog box over the TN3270 Plus terminal window. |
WindowPos(CENTRE) |
centers the AskFor dialog box over the TN3270 Plus terminal window. |
WindowPos(DEFAULT) |
centers the AskFor dialog box over the TN3270 Plus terminal window. This is the default if the WindowPos parameter is not specified. |
WindowPos(CURSOR) |
positions the top left corner of the AskFor dialog box at the cursor location. |
WindowPos(top,left[,PIXELS]) |
positions the top left corner of the AskFor dialog box at the specified pixel offset from the top left corner of the TN3270 Plus window. top and left are the offset in pixels. The offset may be negative to move the dialog box outside the TN3270 Plus window. |
WindowPos(row,col,ROWCOL) |
positions the top left corner of the AskFor dialog box at the specified row and column in the TN3270 Plus terminal window. |
WindowPos(row,col,CURSOR) |
positions the top left corner of the AskFor dialog box at the specified row and column offset from the cursor location in the TN3270 Plus terminal window. |
prompt, defaultData, label, top, left, row and col may be variables.
The AskFor command displays a dialog box requesting information from the user. The AskFor dialog box displays the message and the user accepts the defaultData or types the requested data into the edit box. When the user clicks the OK button the characters from the edit box are typed into the session or placed in the optional $variable. The AskFor command is a good way to provide additional information to lead inexperienced users through a process.
Examples
AskFor("Enter your userid and then click OK",John)
AskFor("Enter your last name and click OK",Doe)
AskFor("Enter your name",BackButton(START:))
$result = AskFor("Enter your password",password)
$name = AskFor("Enter your name","John Doe",WindowPos(10,10,ROWCOL))
Sample Script
'This script prompts the user for logon information.
Askfor("Enter your userid and click OK")
key(tab)
AskFor("Enter your password and click OK",password)
key(enter)
exit
See Also:
TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.