Script Command: inputbox


(Contents)(Previous)(Next)

Format:

inputbox title "Input Box Title" text "Some text to explain the input box" default "default input" store "MACRO_NAME";

The inputbox command displays a dialog where the user may enter variable input to send to the host. The command has these subcommands:

· title : The string following the title keyword appears on the title bar of the dialog.

· text : The string following the optional text keyword appears on the input dialog below the title. Use this text to explain to the script user what they should type in the Input: field of the dialog.

· default: The string following the optional default keyword appears initially in the Input: field of the dialog. The user can accept the default input or edit it to something else. When the user clicks the OK button, PC Access sends the contents of the Input: field to the host.

· store: this is an optional keyword. Specify store to cause PC Access to save the user's response in a runtime macro. You must specify the name of the runtime macro in a string following the store keyword. Usually you will send this runtime macro to the host with a following send command. Runtime macros must be uppercase and can contain only letters or the underscore symbol.

· If you omit the store keyword, PC Access automatically stores the user's response in the runtime macro USER_INPUT. However, the user's response will only be available there until your next inputbox command that omits the store keyword.

Use the inputbox command when you cannot predict what the user will want to send to the host at some point during a script. For example, if your script file navigates an input form from the host, you may wish to let the user type in values for specific fields on the form. Use an inputbox command to obtain user input for each field.

You can conveniently generate an inputbox command while recording a script file with the Create Script Input Dialog window.

Example:

inputbox title "Hello There" message "Enter your name." store "NAME";

send "login ";

send "^!NAME"; // This send the user's response to the input box


(Contents)(Previous)(Next)