DADiSP Worksheet Functions > Function Categories > Menu Functions > GETCONTROLVALUE
Returns the value of a control in a custom dialog box.
GETCONTROLVALUE(id)
id |
- |
An integer, the numeric ID of the target control. |
A string, the control value.
Consider the following dialog box specification:
// getctrl.pan
@dialog
@form
@focus 1
@oninit settext(txtval)
GetcontrolValue
{defvar("txtval", "")}
Text: <id=100 j=3 w=85 m=3>~~
<L>
~txtval = getcontrolvalue(100)
@endform
settext(t)
{
setcontrolvalue(100, t);
}
The dialog is invoked with MENUFILE:
menufile("getctrl.pan")
The dialog box contains a multi-line edit control. When the OK button is pressed, GETCONTROLVALUE assigns the literal text to txtval. Because the text is directly assigned, the text can contain any combination of single and/or double quotes.
GETCONTROLVALUE always returns the control value as a string. Use CASTINTEGER and CASTREAL to convert the value to integer or real form.
See SETCONTROLVALUE to set the value of a control.
See Creating DADiSP Menus for more details on dialog box creation and implementation.