InputBox2

<< Click to Display Table of Contents >>

Navigation:  Reference (Scripting) > Docklight Script Commands - The DL Object > Methods (Advanced) >

InputBox2

Alternative to the original VBScript InputBox method.

 

Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns the contents of the text box. This dialog will always appear on the same screen as the Docklight Scripting main window. It does not support the (rarely useful) optional arguments xpos, ypos, helpfile and context of the VBScript InputBox method.

 

TIP: As an alternative, see also the DL.GetKeyState function on how to wait and react to keyboard or mouse input.

 

Return Value

 

String

 

Syntax

 

result = DL.InputBox2 (prompt[, title][, default])

 

Part

Description

prompt

Required.  String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return plus linefeed character combination (Chr(13) & Chr(10)) between each line.

title

Optional. String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar.

default

Optional. String expression displayed in the text box as the default response if no other input is provided. If you omit default, the text box is displayed empty.

 

'Example DL.InputBox2 Function

MyInput = DL.InputBox2("Please enter text", "My Title", "Example Text")

DL.AddComment MyInput   ' print the user input