DADiSP Worksheet Functions > Function Categories > Menu Functions > GETCONTROLVALUE

 

GETCONTROLVALUE

Purpose:

Returns the value of a control in a custom dialog box.

Syntax:

GETCONTROLVALUE(id)

id

-

An integer, the numeric ID of the target control.

Returns:

A string, the control value.

Example:

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.

Remarks:

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.

See Also:

GETMENUCOORDS

INPUT

MENUCLEAR

MENUDELETE

MENUFILE

MENULIST

MENUPRINT

MENUSHOW

SETCONTROLVALUE

SETMENUCOORDS