You are here: Development Standards > Routines > General Routines > GENCHECK

# GENCHECK

GENCHECK is a general routine that contains a multiline function called FNCHECK(). This function takes a control ID and a string, and toggles a GUI check box control between checked and unchecked states based on the first character in the string. GENCHECK occupies lines 18800–18849 and should be merged into all programs that need to manipulate check boxes while in GUI mode.

Variable | Description
ID | GUI control ID of the check box
PARAM$ | String to check for 'Y' as the first character

To use GENCHECK, add a line in the GUI_DATA section where a YES/NO answer would normally appear in the DATA section of code. For example, if the code in the data block prints YES/NO data like this:

`7720 PRINT @(22,10),PRINT_DETAIL$,`

Its GUI equivalent would read

`17720 LET TMP=FNCHECK(4100,PRINT_DETAIL$)`

There may also be situations where the YES/NO in text is based on a function that looks at a boolean value, such as:

`7720 PRINT @(22,10),FNYESNO$(PRINT_DETAIL)`

The GUI equivalent would read

`17720 LET TMP=FNCHECK(4100,FNYESNO$(PRINT_DETAIL))`

The FNYESNO$() function will evaluate to a YES/NO string, which can then be used in FNCHECK().