DLGSET, DLGSETINT, DLGSETLOG, DLGSETCHAR

Run-Time Functions: Set the values of dialog control variables.

Module: USE DFLOGM

Syntax

result = DLGSET (dlg, controlid, value [, index])
result = DLGSETINT (dlg, controlid, value [, index])
result = DLGSETLOG (dlg, controlid, value [, index])
result = DLGSETCHAR (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
(Input) Integer, logical, or character. The value of the control's variable.


index
(Input; optional) Integer. Specifies the control variable whose value is set. Necessary if the control has more than one variable of the same data type and you do not want to set 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 DLGSET functions to set the values of variables associated with your dialog box controls. Each control has at least one of the integer, logical, or character variables 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 DLGSET to set any control variable. You can also use DLGSETINT to set an integer variable, or DLGSETLOG and DLGSETCHAR to set logical and character values, respectively. If you use DLGSET, 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 set a variable type that is not available, the DLGSET functions return .FALSE..

Calling DLGSET does not cause a callback routine to be called for the changing value of a control. In particular, when inside a callback, performing a DLGSET on a control does not cause the associated callback for that control to be called. Callbacks are invoked automatically only by user action on the controls in the dialog box. If the callback routine needs to be called, you can call it manually after the DLGSET is executed.

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

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: DLGSETSUB, DLGGET, Using Dialogs, Dialog Functions, and Dialog Controls

Example

USE DFLOGM
INCLUDE "DLGRADAR.FD"
TYPE (DIALOG)  dlg
LOGICAL        retlog
...
retlog = DLGSET (dlg, IDC_SCROLLBAR1, 400, dlg_range)
retlog = DLGSET (dlg, IDC_CHECKBOX1, .FALSE., dlg_status)
retlog = DLGSET (dlg, IDC_RADIOBUTTON1, "Hot Button", dlg_title)
...