InputBox function (LotusScript® Language)

Displays a dialog box containing a prompt for user entry, and returns input from the user as a string.

Syntax

InputBox[$] ( prompt [ , [ title ] [ , [ default ] [ , xpos , ypos ] ] ] )

Elements

prompt

A string expression. This is the message displayed in the dialog box. prompt can be any length. LotusScript® defines, but does not enforce, a minimum supported length of 128. The specific product being used (that is, Notes®, ESB, and so on) may impose other limits.

title

Optional. A string expression. This is displayed in the title bar of the dialog box. title can be any length. LotusScript® defines, but does not enforce, a minimum supported length of 128. The specific product being used (that is, Notes®, ESB, and so on) may impose other limits.

If you omit title, nothing is displayed in the title bar. If you omit title and specify either default or xpos and ypos, include a comma in place of title.

default

Optional. A string expression. This is displayed in the text entry field in the dialog box as the default user response. default can be any length. LotusScript® defines, but does not enforce, a minimum supported length of 254. The specific product being used (that is, Notes®, ESB, and so on) may impose other limits.

If you omit default, the text input box is empty. If you omit default and specify xpos and ypos, include a comma in place of default.

xpos

Optional. A numeric expression that specifies the horizontal distance, in units of 1 pixel, between the left edge of the dialog box and the left edge of the display screen. If you omit xpos, the distance is 0. If you specify xpos, you have to specify ypos as well.

ypos

Optional. A numeric expression that specifies the vertical distance, in units of 1 pixel, between the leading edge of the dialog box and the leading edge of the screen. If you omit ypos, the distance is 0. If you specify ypos, you have to specify xpos as well.

Return value

The InputBox function returns a Variant containing a string. InputBox$ returns a String. Returned string can be any length. LotusScript® defines, but does not enforce, a minimum supported length of 254. The specific product being used (that is, Notes®, ESB, and so on) may impose other limits.

Usage

InputBox displays a dialog box with OK and Cancel buttons and a text entry field, interrupting execution of the script until the user confirms the text entry by clicking OK or Cancel. Then InputBox returns that entry. If the user clicks Cancel, InputBox returns the empty string (""). When the user clicks OK or Cancel, execution resumes.

The IBM® software where you are running LotusScript® may allow longer strings than described previously for prompt, title, default, and the text entered into the text entry field. LotusScript® will support longer strings for these items if the IBM® software does, up to the maximum string size.

If you are using LotusScript® from within Notes®, note that the InputBox function writes to:

  • A dialog box when executing on a Notes® client. The user clicks OK, Cancel, Abort, Retry, Yes, or No to continue.
  • NOTES.LOG when executing on a Domino® server.

Example