DLGGET, DLGGETINT, DLGGETLOG, DLGGETCHAR

Run-Time Functions: Retrieve the state of the dialog control variable.

Module: USE DFLOGM

Syntax

result = DLGGET (dlg, controlid, value [, index])
result = DLGGETINT (dlg, controlid, value [, index])
result = DLGGETLOG (dlg, controlid, value [, index])
result = DLGGETCHAR (dlg, controlid, value [, index])


dlg
(Input) Derived type DIALOG. Contains dialog box parameters. The components of the type DIALOG are defined with the PRIVATE attribute, and cannot be changed or individually accessed by the user.


controlid
(Input) Integer. Specifies the identifier of a control within the dialog box. Can be either the symbolic name for the control or the identifier number, both listed in the Include file (with extension .FD).


value
(Output) Integer, logical, or character. The value of the control's variable.


index
(Input; optional) Integer. Specifies the control variable whose value is retrieved. Necessary if the control has more than one variable of the same data type and you do not want to get the value of the default for that type.

Results:

The result is of type LOGICAL(4). The result is .TRUE. if successful; otherwise, the result is .FALSE..

Use the DLGGET functions to retrieve the values of variables associated with your dialog box controls. Each control has at least one of the integer, logical, or character variable associated with it, but not necessarily all. The control variables are listed in the table in Control Indexes in the Programmer's Guide. The types of controls they are associated with are listed in the table in Available Indexes for Each Dialog Control in the Programmer's Guide.

You can use DLGGET to retrieve the value of any variable. You can also use DLGGETINT to retrieve an integer value, or DLGGETLOG and DLGGETCHAR to retrieve logical and character values, respectively. If you use DLGGET, you do not have to worry about matching the function to the variable type. If you use the wrong function type for a variable or try to retrieve a variable type that is not available, the DLGGET functions return .FALSE..

If two or more controls have the same controlid, you cannot use these controls in a DLGGET operation. In this case the function returns .FALSE..

The dialog box does not need to be open to access its control variables.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: DLGSET, DLGSETSUB, DLGINIT, DLGMODAL, DLGMODELESS

Example

USE DFLOGM
INCLUDE "THISDLG.FD"
TYPE (DIALOG)  dlg
INTEGER        val
LOGICAL        retlog, is_checked
CHARACTER(256) text
...
retlog = DLGGET (dlg, IDC_CHECKBOX1, is_checked, dlg_status)
retlog = DLGGET (dlg, IDC_SCROLLBAR2, val, dlg_range)
retlog = DLGGET (dlg, IDC_STATIC_TEXT1, text, dlg_title)
...