Programming Guide |
Tests a field for yes
int sm_is_yes(int field_number);int sm_e_is_yes(char *field_name, int element);int sm_i_is_yes(char *field_name, int occurrence);int sm_n_is_yes(char *field_name);int sm_o_is_yes(int field_number, int occurrence);
field_name
,field_number
- The field to test.
element
- The element in
field_name
to test.occurrence
- The occurrence in the field to test.
- 1 True: The field's first character matches the first character of the
SM_YES
entry in the message file.
sm_is_yes
compares the first character of the data in the specified field or occurrence to the first letter of theSM_YES
entry in the message file, ignoring case. A return of 0 (failure) does not indicate whether the failure occurred because the field contains the value ofSM_NO
or for another reason. To test forSM_NO
, use sm_is_no.You can use this function with one-letter fields that specify the yes/no character edit. For these fields, users can enter only the values
SM_YES
orSM_NO
, or space (= SM_NO
). Unlike some other functions,sm_is_yes
does not ignore leading blanks.