OK button

Use an OK button on windows used solely for viewing information (such as an inquiry window) or on setup or preferences windows, used in maintaining a single record. For windows whose contents are display only, an OK button can appear by itself.

For setup and preferences windows, use a Cancel button with an OK button. The OK button should always save changes to a preferences file or a setup table. In addition, always run the OK button change script when the user presses the ENTER key. To do this, set the OK button’s Default property to True.

Example 4: OK button change script

The following example saves changes made to the User Preferences window. It saves preferences for the current user to the SY_Users_MSTR table, and sets global variables.

{Save the record.}
copy to table SY_Users_MSTR;
save table SY_Users_MSTR;
clear changes window User_Preferences;
{Set global variables.}
'Print to Printer' of globals = 'Print to Printer';
'Print to Screen' of globals = 'Print to Screen';
'Distributed Processes' of globals = 'Distributed Processes';

close form SY_User_Preferences;


Documentation Feedback