InputBox Function | |
-- 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.21
Syntax FUNCTION InputBox(
cInputPrompt,
cDialogCaption,
cDefaultValue,
nTimeout,
cTimeoutValue,
cCancelValue
) AS STRING CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static string InputBox(
Usual cInputPrompt = default,
Usual cDialogCaption = default,
Usual cDefaultValue = default,
Usual nTimeout = default,
Usual cTimeoutValue = default,
Usual cCancelValue = default
)
Request Example
View SourceParameters
- 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:
StringRemarks
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.
1Y = "Nothing at all"
2Y = InputBox("TypeHere","Input ",Y,5000)
3
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."
1Clear
2Y = InputBox("Type Here:", "Input Title", ;
3"Nothing at all", 5000, 'Timed Out', 'Canceled')
4? Y
See Also