Check Box Fields

A check box is similar to a Boolean toggle field. It has one of two possible values: checked (ON) or not checked (OFF). If a field is checked, it contains an X; if it is not checked, the field contains a space. The user cannot enter data; he or she presses the Space bar to toggle between the two values.

The specifics for using a check box field are summarized below:

Field Type F_CHECK
Header File vv_check.h
Data Variable UCHAR data

Check box data is always stored as 0 (not checked) or 1 (checked). Initialize the data variable to 0 or 1 before processing the form.

Picture Control The control characters X, A, Z, *, and ! are allowed in check box fields. You can have as many protected characters as you desire in check box fields, but there must be only one picture control character.
Code Example UCHAR choice = '1';

check_fldp = fld_def(4, 1, "Display status line ",
FADJACENT, "[A]", F_CHECK,
(PTR) &choice, dfmp);
  The field will be initially displayed with an X showing at the position of the picture control character. Only this position in the field can be changed. The user presses the Space bar to toggle the field value.


Home Contents Previous Next