Promotic
WikipediaLinkedInYoutubeTwitterFacebook

InputBox - function of language VBScript

Description:
Displays a prompt in a window, waits for the user to input text or click a button, and returns the contents of the text box.
Syntax:
InputBox(prompt As String, [title As String], [default As String], [xpos As Integer], [ypos As Integer], [helpfile As String], [context As Integer]) As String
Calling:
s = InputBox(prompt[, titul][, default][, xpos][, ypos][, helpfile, context])
Parameters:
prompt(String) String expression presented as a message in the window. 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 the vbCr, vbLf or vbCrLf constants between each line.
title[optional] (String) String expression presented in the title bar of the window. If you omit the title, the application name is placed in the title bar.
default[optional] (String) String expression presented in the text box as the default response if no other input is provided. If you omit default, the text box is empty.
xpos[optional] (Integer) Numeric expression that specifies the horizontal distance of the left edge of the window from the left edge of the screen (in pixels). If xpos is omitted, the window is horizontally centered.
ypos[optional] (Integer) Numeric expression that specifies the vertical distance of the upper edge of the window from the top of the screen (in pixels). If ypos is omitted, the window is vertically positioned approximately 1/3 of the way down the screen.
helpfile[optional] (String) String expression that identifies the Help file to use to provide context-sensitive Help for the window. If helpfile is provided, context must also be provided.
context[optional] (Integer) Numeric expression that identifies the Help context number assigned by the Help author to the appropriate Help topic. If context is provided, helpfile must also be provided.
Return Values:

If the user clicks OK or presses Enter key, the function returns String whatever is in the text box.

If the user clicks Cancel, the function returns a zero-length string ("").

Note:
When both helpfile and context are supplied, a Help button is automatically added to the window.
Example:
Dim sInput
sInput = InputBox("Enter your name")
MsgBox ("You entered:" & sInput)
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice