Specifications

Chapter 15. Function Reference
342
Syntax:
CHKDGT$(barcodedata,CDtype)
Parameter:
barcodedata and CDtype
String expressions.
Description:
CHKDGT$ calculates a check digit (CD) of barcodedata according to the calcu-
lation method specified by
CDtype, and then returns it as one-character string.
CDtype is A, H, I, M or N, which specifies the bar code type and the corre-
sponding calculation method as listed below.
* Supported by the BHT-100B only.
CDtype may be in lowercase.
If barcodedata contains a character(s) out of the specification of the bar code
type specified by
CDtype, then CHKDGT$ returns a null string. However, if only
the CD position character in
barcodedata is out of the specification,
CHKDGT$ calculates the correct CD and returns it as one-character string.
Sample coding 1:
CD.Data$=CHKDGT$("494AB4458","A")
"A" and "B" are out of the specification of EAN or UPC, so
CD.Data$ will become a null string.
Sample coding 2:
CD.Data$=CHKDGT$("4940045X","A")
"X" is a CD position character, so CHKDGT$ calculates the
correct CD and
CD.Data$ will become "8."
Sample coding 3:
CD.Data$=CHKDGT$("a0ef3-a","N")
"e" and "f" are out of the specification of Codabar (NW-7), so
CD.Data$ will become a null string.
CHecK DiGiT String function
CHKDGT$
Returns a check digit of bar code data.
CDtype
Bar Code Type Calculation Method
A
EAN and UPC MOD-10 (Modulo arithmetic-10)
H
STF (Standard 2 of 5) * MOD-10 (Modulo arithmetic-10)
I
ITF (Interleaved 2 of 5) MOD-10 (Modulo arithmetic-10)
M
Code 39 MOD-43 (Modulo arithmetic-43)
N
Codabar (NW-7) MOD-16 (Modulo arithmetic-16)