Denso BHT-202Q Bedienungsanleitung Seite 144

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 407
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 143
When CD type is P (MSI):
The barcode data must be two or more digits in length. Otherwise,
this function throws
an exception. To calculate a two-digit CD, call this function twice.
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("123456782", "P") = Asc("2")) Then
Console.WriteLine ("CD OK")
End If
[C#]
UnicodeEncoding encode = new UnicodeEncoding();
if (Scanner.GetChkDigit("123456782", 'P') == (int)encode.GetBytes("2")[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 origData As String = "12345678"
Dim digit As Integer = Scanner.GetChkDigit(origData+"0", "P")
Console.WriteLine("CD = {0}", origData + New String(Chr(digit), 1))
[C#]
string origData = "12345678";
int digit = Scanner.GetChkDigit(origData+"0", 'P');
byte[] digitByteArray = {(byte)digit};
ASCIIEncoding encode = new ASCIIEncoding();
Console.WriteLine("CD = {0}", origData + encode.GetString(digitByteArray, 0, 1));
Result
> CD = 123456782
135
Seitenansicht 143
1 2 ... 139 140 141 142 143 144 145 146 147 148 149 ... 406 407

Kommentare zu diesen Handbüchern

Keine Kommentare