InputBox (function)

<< Click to Display Table of Contents >>

InputBox (function)

InputBox(Prompt$ [,[Title$] [,[Default$] [,X, Y]]])

Displays a dialog box in which the user can input something. The result is a string consisting of the user input.

function_inputbox

Prompt$ is the string to be shown in the dialog box.

The following parameters are optional:

Title$ is the string to be shown in the title bar.

Default$ is the string shown in the input box by default.

X and Y are the screen coordinates of the input box in screen pixels.

See also: Dialog

Example:

Sub Main

 Title$ = "Welcome!"

 Prompt$ = "What is your name?"

 Default$ = ""

 X% = 100

 Y% = 200

 N$ = InputBox(Prompt$, Title$, Default$, X%, Y%)

 MsgBox "Hello " & N$ & "!"

End Sub