Intel® Fortran Compiler XE 13.1 User and Reference Guides
Dialog Subroutine: Sets the return value for the DLGMODAL function from within a callback subroutine.
CALL DLGSETRETURN (dlg,retval)
(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.
(Input) Integer. Specifies the return value for DLGMODAL upon exiting.
DLGSETRETURN overrides the default return value with retval. You can set your own value as a means of determining the condition under which the dialog box was closed. The default return value for an error condition is -1, so you should not use -1 as your return value.
DLGSETRETURN should be called from within a callback routine, and is generally used with DLGEXIT, which causes the dialog box to be exited from a control callback rather than the user selecting the OK or Cancel button.
SUBROUTINE SETRETSUB (dlg, button_id, callbacktype)
TYPE (DIALOG) dlg
LOGICAL is_checked, retlog
INTEGER return, button_id, callbacktype
retlog = DLGGET(dlg, IDC_CHECKBOX4, is_checked, dlg_state)
IF (is_checked) THEN
return = 999
return = -999
CALL DLGSETRETURN (dlg, return)
CALL DLGEXIT (dlg)
END SUBROUTINE SETRETSUB