Barcode Interleaved - Mod11 Check Digit
Hello, guys
I've been searching a lot about this but i couldn't find any answer.
Our customer needs a barcode with 11 digits (interleaved symbology) + Mod11 Check Digit.
I know that it can be done with VBscript but i know nothing about this.
Explanning the code:
67 (only for control, not count for check digit)-90124568444-X (X= Mod11 check digit)
Examples:
67-90124568444-X
67-90124568445-X
67-90124568446-X
what code i have to use? i understand nothing about programmig.
Pleaaase! i need your help guys!
-
BarTender supports a range of check digit functions in VB script, some of which are based on Mod 11, which is a very general, non-specific term. If one of these functions is right for you then you can use it in the below manner, which references the named data source value you set for the data part of the barcode.
ISO7064Mod11_10(Format.NamedSubStrings("barcode").Value)
0 -
BarTender supports a range of check digit functions in VB script, some of which are based on Mod 11, which is a very general, non-specific term. If one of these functions is right for you then you can use it in the below manner, which references the named data source value you set for the data part of the barcode.
ISO7064Mod11_10(Format.NamedSubStrings("barcode").Value)
Thanks for the fast answer!
i tried it but don't make the digit that the customer want.
They already have the software with formula to calculate the check digit but is for the inkjet printer and now they want to do it with a printer that uses Bartender .
Here is the code that the customer uses:
Private Function DV_PID(ByVal numPedido As String) As IntegerDim numSoma As LongDim numResto As IntegernumSoma = 0numSoma = numSoma + Val(Mid(numPedido, 11, 1)) * 2numSoma = numSoma + Val(Mid(numPedido, 10, 1)) * 3numSoma = numSoma + Val(Mid(numPedido, 9, 1)) * 4numSoma = numSoma + Val(Mid(numPedido, 8, 1)) * 5numSoma = numSoma + Val(Mid(numPedido, 7, 1)) * 6numSoma = numSoma + Val(Mid(numPedido, 6, 1)) * 7numSoma = numSoma + Val(Mid(numPedido, 5, 1)) * 8numSoma = numSoma + Val(Mid(numPedido, 4, 1)) * 9numSoma = numSoma + Val(Mid(numPedido, 3, 1)) * 10numSoma = numSoma + Val(Mid(numPedido, 2, 1)) * 2numSoma = numSoma + Val(Mid(numPedido, 1, 1)) * 3numResto = numSoma Mod 11DV_PID = IIf(numResto = 0 Or numResto = 1, 0, 11 - numResto)End FunctionBelow some codes that hey already make a check digit:90122620215-890124862214-190124846597-6I need to generate in bartender this sames mod11 check digits and i don't understand anything about programming =/0 -
You just need to write the same code, but adapted to the VB script syntax.
VB Script uses a variant type for variables so the below dimension command example is all you need:
Dim numSoma
For each summed calculation something like the below should do it:
numSoma = numsoma + (Mid(numPedido,11, 1) * 2)
Of course if numPedidio is really just the value of a named data source then it could look like the below:
numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,11, 1) * 2)
The last bit should be very similar:
numResto = numSoma Mod 11value = IIf(numResto = 0 Or numResto = 1, 0, 11 - numResto)0 -
You just need to write the same code, but adapted to the VB script syntax.
VB Script uses a variant type for variables so the below dimension command example is all you need:
Dim numSoma
For each summed calculation something like the below should do it:
numSoma = numsoma + (Mid(numPedido,11, 1) * 2)
Of course if numPedidio is really just the value of a named data source then it could look like the below:
numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,11, 1) * 2)
The last bit should be very similar:
numResto = numSoma Mod 11value = IIf(numResto = 0 Or numResto = 1, 0, 11 - numResto)Thanks a lot
Here is my code
Dim numSomanumSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,11, 1) * 2)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,10, 1) * 3)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,9, 1) * 4)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,8, 1) * 5)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,7, 1) * 6)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,6, 1) * 7)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,5, 1) * 8)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,4, 1) * 9)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,3, 1) * 10)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,2, 1) * 2)numSoma = numsoma + (Mid(Format.NamedSubStrings("barcode").Value,1, 1) * 3)numResto = numSoma Mod 11value = IIf(numResto = 0 Or numResto = 1, 0, 11 - numResto)But bartender send-me an error "line 1: value = dim numsoma: sintax error".0 -
DId you set this to be a multi-line or event based VB Script? The error indicates to me that it's set to a single line expression.
0 -
DId you set this to be a multi-line or event based VB Script? The error indicates to me that it's set to a single line expression.
thanks, its working without error but now the check digit is very big.
my barcode: 90122620215
check digit generated: 1179656
The check digit must to be only one digit.
Sorry for all this questions but i really know nothing about this
0 -
Okay, try this:
Dim numSoma, numResto numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,11, 1) * 2) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,10, 1) * 3) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,9, 1) * 4) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,8, 1) * 5) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,7, 1) * 6) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,6, 1) * 7) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,5, 1) * 8) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,4, 1) * 9) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,3, 1) * 10) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,2, 1) * 2) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,1, 1) * 3) numResto = numSoma Mod 11 value = IIf(numResto = 0 Or numResto = 1, 0, 11 - CInt(numResto))
0 -
Ooops, I named my data source btBarcode, so you want to change that back to "barcode" if that's what you're using in your document.
0 -
Okay, try this:
Dim numSoma, numResto numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,11, 1) * 2) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,10, 1) * 3) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,9, 1) * 4) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,8, 1) * 5) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,7, 1) * 6) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,6, 1) * 7) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,5, 1) * 8) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,4, 1) * 9) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,3, 1) * 10) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,2, 1) * 2) numSoma = numsoma + (Mid(Format.NamedSubStrings("btBarcode").Value,1, 1) * 3) numResto = numSoma Mod 11 value = IIf(numResto = 0 Or numResto = 1, 0, 11 - CInt(numResto))
Man... i don't know how i can say that but you are an angel!! hahaThanks a lot! it works very fine! =DI tested with a lot of codes that the our customer sent to us to compare and everything is perfect!The internet needs more people like you.Thanks again and have a nice a day!0 -
You're very kind; I'll give my halo and extra polish today.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
10 Kommentare