AskFor - display a dialog box that asks the user for input

Return to Introduction  Previous page  Next page

AskFor  "message text"[,password][,$variable][,"default data"][,WindowPos(top,left)]

Where:

message textis text telling the user what to enter into the AskFor dialog box.        
passwordan optional keyword that indicates asterisks (*) are displayed rather than the text the user types into the AskFor dialog box.        
$variablean optional variable name. The data the user types into the AskFor dialog box is associated with 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
default datathis text appears in the edit box within the AskFor dialog. The user can accept this data by pressing enter or change it by typing over it.        
WindowPos(top,left)specifies the position of the top left corner of the AskFor dialog box. top and left are the offset in pixels from the top left corner of the TN3270 Plus main window. The offset may be negative to move the dialog box outside the TN3270 Plus window. If this parameter is not specified, the dialog box is displayed in the center of the TN3270 Plus main window.

top and left may be variables.

The AskFor command displays a dialog box requesting information from the user. The AskFor dialog box displays the message text and the user accepts the default data 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 password",password
AskFor"Enter your name",$NAME,"John Doe",WindowPos(10,10)

 

The following script asks the user for logon information.

 

Askfor"Enter your userid and click OK"        
keytab        
AskFor"Enter your password and click OK",password        
keyenter        

exit

 

See Also:

 

Script Command Summary

Script Variables

Using the Scripting Language


TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.