Creating Custom Check Digits

You can create a custom check digit in Visual Basic Script (VBScript) by using an existing check digit algorithm or by creating a custom algorithm.

ClosedTo create a custom check digit by using an existing algorithm

  1. Double-click the barcode to open the Barcode Properties dialog. Alternatively, right-click the barcode, and then click Properties.

  2. In the navigation pane, select the data source that contains the data to encode.

  3. Click the icon on the data source toolbar to start the New Data Source wizard.

  4. In the Type list, select Visual Basic Script, and then click Finish.

  5. In the Script Type list, select Single-Line Expression, and then click Edit with Script Editor to open the Script Editor.

  6. In the Editor pane, delete any existing expression text.

  7. In the Script Assistant pane, expand the Functions node, expand the Check Digit node, and then double-click the check digit type that you want.

  8. In the Script Assistant pane, locate and then double-click the data source that you want to use to replace the highlighted text ("String").

  9. Click OK to close the Script Editor.

ClosedTo create a custom check digit by using a custom algorithm

  1. Double-click the barcode to open the Barcode Properties dialog. Alternatively, right-click the barcode, and then click Properties.

  2. In the navigation pane, select the data source that contains the data to encode.

  3. Click the icon on the data source toolbar to start the New Data Source wizard.

  4. In the Type list, select Visual Basic Script, and then click Finish.

  5. In the Script Type list, select Multi-Line Script, and then click Edit with Script Editor to open the Script Editor.

  6. In the Editor pane, delete any existing expression text.

  7. Enter your custom check digit calculation algorithm, such as the following:

    'Create a Mod43 check digit

    charSet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"

    For i = 1 To Len(C39)

    total = InStr(charSet, Mid(C39,i,1)) - 1 + total

    Next

    Value = Mid(charSet, (total Mod 43 + 1), 1)

  8. Click OK to close the Script Editor.

Related Topics