>This is my first time in the forum.
>I would like to ask for help on how to generate by code the 13th number (it is a checksum) from the first 12 numbers of an EAN13 barcode
>This is done automatically by barcode printers. How do we do it in VFP ?
Hi Edward,
The check character for the UPC/EAN codes is generated by the following method:
1.Designate the rightmost character odd.
2.Sum all of the characters in the odd positions and multiply the result by three.
3.Sum all of the characters in the even positions
4.Add the odd and even totals from steps two and three.
5.Determine the smallest number that when added to the result from step four, will result in a multiple of 10. This is the check character.
EAN 13 Example:
Flag characters = 20
Message characters = 0123456789
Position = EOEOEOEOEOEO
Sum of odd positions = 0 + 1 + 3 + 5 + 7 + 9 = 25
Odd positions X 3 = 25 x 3 = 75
Sum of even positions = 2 + 0 + 2 + 4 + 6 + 8 = 22
Sum of even and odd = 75 + 22 = 97
Check character = 3
Tag to be encoded = 2001234567893
More info available at :
http://www.semiconductor.agilent.com/barcode/sg/Misc/upc.html#A1.4.2.1