Validates data with a check digit functionint sm_ckdigit(int field_number, char *field_data, int occurrence, int modulus, int minimum_digits);
- The field to validate. If
sm_ckdigituses the data in
field_data. If an error occurs and
field_numberis 0, no message is posted.
- Specifies the data to validate. If
field_datais null, the string to check is obtained from the
occurrenceand an error message is displayed if the string is bad.
- The occurrence in
- Specifies the check digit algorithm to use. By default,
sm_ckdigitsupports mod 10 and mod 11 algorithms. For more information about the check digit algorithms, refer to the source code of
sm_ckdigitthat is distributed with Panther.
- The minimum number of digits required by the check digit algorithm.
sm_ckdigitchecks whether the data in
occurrencecontains the required minimum number of digits and ends with the proper check digit. This function is typically called by Panther at field validation; it uses the values in the field's Check Digit and Minimum Digits properties as arguments for parameters
If you specify a field occurrence and its data is invalid, Panther issues an error message before returning. If you set
field_numberto 0 and supply invalid data for
field_data, Panther does not issue any message.
You can install your own check digit function to replace
sm_ckdigit. For more information on installing functions, refer to "Installing Functions" in the Application Development Guide.