Zum Hauptinhalt gehen

Suche

Suche

Vb Script Help On A Multi Output Custom Check Digit

Kommentare

7 Kommentare

  • Avatar
    Fernando Ramos Miracle

    Hello James,

     

    I've taken a look at your PDF and transcript it to VB Script for you. You'll find a document attached with both check digits. I've also atached the actual script on separate .txt files (both check digits and the custom "Mod" function I needed to create).

     

    Things to consider:

     

    1. Only the three number check digit applies a control over what data is being entered (following the instructions on your PDF). I've added the script for it on this check digit, but it's easier to simply apply a character filter in BarTender so only alphanumeric values can be entered (or a custom filter to also add "." and "-").

     

    2. Due to the limit of the "double" type data, both check digits can only be calculated over values under a certain maximum value (note that "Alpha" values will be substituted by two character numbers). If the entered value ends up being a number greater than the maximum the result will be "0" (for the 2 numbers check digit) or "1" (for the three numbers check digit).

     

    3. Note that the script is set in both the "OnAutoSelectedEvent" and "OnPrintStart" events.

     

    4. The variables and the required custom "Mod" function are specified in the "Functions and Subs" event.

     

    Cheers.

    1
  • Avatar
    Legacy Poster

    Fernando,

       Thank you so much for you help.  I had to do a little tweaking but everything is working great, thanks again.  On the 2ChekDigit, for the "calc = MyMod(MyMod(CDbl(result)*100, 97), 97)" line I added

    "98-"; the changed line now reads; "calc = MyMod(98- MyMod(CDbl(result)*100, 97), 97)"

     

        For the 3CheckDigit I had to add "result = Right(result, 10)" above the "calc = MyMod((998 - MyMod((CDbl(Right(result, 16))*1000),997)), 997)" Line.  This was to account for the fact that it only needed to go up to 10 digits to the right, but still change all 15 of the digits in the number.

     

    James

    0
  • Avatar
    Legacy Poster

    hi 

    Fernando

     could u please help me with vb script. i have bar code IMEI with code 128C. i cant use another code type. how i can remove leading zero from my IMEI bar code.

     

    that after printing, scanner will read only IMEI number without leading zero

     

    thanks

    0
  • Avatar
    Fernando Ramos Miracle

    Hello Petruha,

     

    Could you let me know how many characters are you entering in the barcode? Please note that the code set C of the Code 128 symbology encodes values in pairs. If you've entered an odd number of characters it will always add a leading zero. This is a symbology specification and cannot be avoided. If you want to prevent this leading zero you'll need to use a different code set or configure your scanner to ignore it (if at all possible).

     

    Regards.

    0
  • Avatar
    Legacy Poster

    yep, could u suggest another code type for IMEI number (it includes is 15 digits).  the problem is that a label has a dimensional limits for printing bar code. i tried different code types and they are too big for label , or too small for scanner recognition.

     

     

    the optimal parameters in my label : X dimension 0.25 mm and Char density is 0.727 ch/mm.  (code 128C) 

    0
  • Avatar
    Fernando Ramos Miracle

    You could try a 2D barcode instead of a linear one (such as Data Matrix, QR codes, PDF417...), the latter are able to represent way more data per area unit.

     

    Regards

    0
  • Avatar
    Lewis Ragonick

    Can you please repost this document.

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.