Click or drag to resize

InputBox Function

X#
-- todo --
Displays a modal dialog used by a parameterized view for input of a single string.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION InputBox(
	cInputPrompt,
	cDialogCaption,
	cDefaultValue,
	nTimeout,
	cTimeoutValue,
	cCancelValue
) AS STRING CLIPPER
Request Example View Source

Parameters

cInputPrompt (Optional)
Type: Usual
Specifies the Prompt displayed above the text entry box.
cDialogCaption (Optional)
Type: Usual
Specifies the text to display in the title bar of the dialog box.
cDefaultValue (Optional)
Type: Usual
Specifies a default value to display in the text entry box.
nTimeout (Optional)
Type: Usual
Specifies a timeout value in 1/1000 seconds. Specify zero in nTimeout to prevent the dialog from timing out. This is identical to omitting nTimeout.
cTimeoutValue (Optional)
Type: Usual
Specifies value to return if a timeout occurs. cTimeoutValue isn't returned if nTimeout is set to zero or is omitted.
cCancelValue (Optional)
Type: Usual
Specifies a character value to return if the user exits the dialog box by choosing the Cancel button or pressing the Esc key.

Return Value

Type: String
Remarks
The dialog box displays an edit box and OK and Cancel buttons. The OK button returns the contents of the edit box. A timeout returns the text specified in cTimeoutValue or an empty string if cTimeoutValue is unspecified. The Cancel button or the Esc key returns the text specified in cCancelValue or an empty string if cCancelValue is unspecified.
X#
1Y = "Nothing at all"
2Y = InputBox("TypeHere","Input ",Y,5000)
3// Displays dialog box for 5 seconds,
The following example displays a dialog box for five seconds and displays the return value in the main X# window. If the user clicks OK, the edit box returns the text which is either the default value, "Nothing at all," or user-specified text. If the user clicks Cancel or hits the Esc key, the edit box returns "Canceled." If the user waits the timeout period, the edit box closes and returns "Timed Out."
X#
1Clear
2Y = InputBox("Type Here:", "Input Title",  ;
3"Nothing at all", 5000, 'Timed Out', 'Canceled')
4? Y
See Also