Programming Guide



sm_*is_no

Tests a field for no

int sm_is_no(int field_number);
int sm_e_is_no(char *field_name, int element);
int sm_i_is_no(char *field_name, int occurrence);
int sm_n_is_no(char *field_name);
int sm_o_is_no(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.

Returns

Description

sm_is_no compares the first character of the data in the specified field or occurrence to the first letter of the SM_NO 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 of SM_YES or for another reason. To test for SM_YES, use sm_is_yes.

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 or SM_NO, or space (= SM_NO). Unlike other functions, sm_is_no does not ignore leading blanks.

See Also

sm_is_yes