Denso BHT-202Q Bedienungsanleitung Seite 142

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 407
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 141
When CD type is N (Codabar):
The barcode data must be three or more digits in length, including the start and stop
characters. Otherwise,
this function throws an exception.
To check whether the CD is correct, pass a piece of barcode data with a CD to the
Scanner.GetChkDigit method as shown below. If the returned value is equal to the CD,
then the CD is correct.
[VB]
If (Scanner.GetChkDigit("a0123-a", "N") = Asc("-")) Then
Console.WriteLine ("CD OK")
End If
[C#]
UnicodeEncoding encode = new UnicodeEncoding();
if (Scanner.GetChkDigit("a0123-a", 'N') == (int)encode.GetBytes("-")[0]) {
Console.WriteLine ("CD OK");
}
To append a CD to barcode data, pass a piece of barcode data with a dummy character
appended to the Scanner.GetChkDigit method as shown below. The returned value
will be the CD. Replace the dummy character with the returned value.
[VB]
Dim origDataF As String = "a0123"
Dim origDataR As String = "a"
Dim digit As Integer = Scanner.GetChkDigit(origDataF+"0"+ origDataR, "N")
Console.WriteLine("CD = {0}", origDataF + New String(Chr(digit), 1) + origDataR)
[C#]
string origDataF = "a0123";
string origDataR = "a";
int digit = Scanner.GetChkDigit(origDataF+"0"+ origDataR, 'N');
byte[] digitByteArray = {(byte)digit};
ASCIIEncoding encode = new ASCIIEncoding();
Console.WriteLine("CD = {0}", origDataF+encode.GetString(digitByteArray, 0,
1)+origDataR);
Result
> CD = a0123-a
133
Seitenansicht 141
1 2 ... 137 138 139 140 141 142 143 144 145 146 147 ... 406 407

Kommentare zu diesen Handbüchern

Keine Kommentare