Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


8.6.1 InputBox (display a message and text boxes)

Purpose

Displays a message and text boxes in a dialog box, and returns the text box contents when the user enters text or clicks a button.

Syntax
InputBox ([Text], [Title], [xPos], [yPos], InputBuff1, [Caption1], [InputBuff2], [Caption2], ...)
Arguments
Text

Specify the message string to be displayed in the dialog box. Write a character string or a variable that stores this value. If #Option = NOCHANGE is missing from the head of the script file, any \r, \n, \t, or \\ strings included in the message text are processed as control codes.

For details about control codes, see 6.1.11 Script coding conventions.

Title

Specify the title to be displayed in the title bar as a character string or as a variable that stores this value.

This value is optional. If you omit this value, JP1/Script InputBox appears in the title bar.

xPos

Specify the horizontal distance from the left side of the screen to the left edge of the dialog box. Specify the distance in pixels, where the left side of the screen is 0, or write a variable that stores this value. If you omit this argument, the dialog box is centered horizontally on the screen. If you specify a negative value, zero is assumed.

yPos

Specify the vertical distance from the top of the screen to the top of the dialog box. Specify the distance in pixels, where the top of the screen is 0, or write a variable that stores this value. If you omit this argument, the dialog box is centered vertically on the screen. If you specify a negative value, zero is assumed.

InputBuff1 to InputBuff4

Specify variables for storing the strings that the user types in the text boxes. You can specify up to four text boxes. If you preset a value in a buffer variable, that value will appear in the text box as its initial value. If the user does not enter anything in an text box, a zero-length string ("") is stored in the associated buffer variable.

Caption1 to Caption4

Specify a caption for each of the text boxes you set in InputBuff1 to InputBuff4. Write each caption as a string of up to 40 characters, or as a variable that stores this value.

This value is optional. If you omit this value, the text box will have no caption.

Description

The InputBox command displays a message and up to four text boxes according to the specified parameters. The command returns True on successful execution, or False if an error occurs.

An OK button and Cancel button are added to the message box. When the user presses the OK button or the Enter key, the command returns the contents of the text boxes. If the user presses the Cancel button, the command returns zero-length strings ("").

The value of the button that the user chooses is stored in the _MSG_RTN_ reserved variable as either of the following:

Value

Button chosen by the user

OK

OK

CANCEL

Cancel

Note

You cannot use this command in a script started as a service. An execution error occurs if this command is used.

Example
Dim compName
Dim userName
InputBox ("Type your company name and your user name.", _
          "User Registration",100,100,compName, _
          "Company Name", userName, "User Name")

Display example

[Figure]

JP1/Script version

Supported from JP1/Script 01-00.