
■ Note
If the
barcode data within the code (excluding the check digit positions) contains any
characters outside the character set corresponding to the barcode type specified by the
check digit type, this function throws an exception. However, if only the check digit
positions contain a character outside the valid character set, then
this function
calculates the correct check digit and returns it as a single-character string.
[VB] Scanner.GetChkDigit("494AB4458", "A")
[C#] Scanner.GetChkDigit("494AB4458", "A")
Since "A" and "B" lie outside the valid character set for EAN (JAN) or UPC, an exception
is thrown.
[VB] Scanner.GetChkDigit("4940045X", "A")
[C#] Scanner.GetChkDigit("4940045X", "A");
"X" lies outside the valid character set but is in the CD position, and therefore the
correct CD (ASCII "8") is calculated and returned.
[VB] Scanner.GetChkDigit("a0ef3-a", "N")
[C#] Scanner.GetChkDigit("a0ef3-a", "N");
Since "e" and "f" lie outside the valid character set for Codabar (NW-7), an exception is
thrown.
[VB] Scanner.GetChkDigit("a123Qa", "N")
[C#] Scanner.GetChkDigit("a123Qa", "N");
"Q" lies outside the valid character set but is in the CD position, and therefore the
correct CD (ASCII "-") is calculated and returned.
129
Comentários a estes Manuais