Mod 11 Check Digit
Totally new to Bartender and have been thrown in at the deep end.
I have a barcode that needs a check digit adding to it. I've sussed out how to do this in VB editor but need help on creating the script. None of the standard Mod 11 scripts give the correct results. I can produce the correct results on excel but need to translate this to a script that will work.
The excel fomula that works is =CONCATENATE(A2,RIGHT(MOD(A2,11),1) A2 being the barcode.
Examples are:
009876010 check digit is 1 therefore 0098760101
009876009 check digit is 0 therefore 0098760090
009876008 check digit is 10 therefore 0098760080 (Only the 0 is added).
If anyone can help it would be greatly appreciated.
-
Hi Tony,
You need to use the X MOD Y command for this.
Here is a sample
I have made the barcode up of 3 substrings, two of which are named as "firstbit" and "lastbit" whilst the 3rd is the VB routine.
For the VB I have set this as an Event Controlled Script and I was using the OnSerialise option as the numbers in your example were going down and script I used was
Value1 = Format.NamedSubStrings("firstbit").Value & Format.NamedSubStrings("lastbit").Value
Value = Value1 Mod 11To this I have added an If...then....else statement to just add the 0 and not the 10 (such as for 009876008)
If value = "10" then
Value = "0"
else Value = Valueend if
Value = Value
0
Please sign in to leave a comment.
Comments
1 comment