You can't do a mod 10 on a code with letters, mod 10 is applied to a number, and it's really simply the last digit of that number, so mod 10 is not a good choice for a check digit.
EAN13 barcodes, which have a 13th check digit do compute mod 10, but it's not applied on the net 12 digit number before the check digit, because that would mean the 13th digit would simply copy the 12th.
The algorithm for the check digit is calculating a sum of the digits, each odd digit (1st, 3rd etc) is multiplied by 3 - this helps to find out if there is a typing eror/turner. But again this only works on digits, not letters. You might use the ascii codes of the letters instead, eg calculate the following would be a solution:
Code:
Function checkdigit()
LParameters tcCode
Local lnCount, lnChecksum
lnChecksum = 0 && could also initialise differently
For lnCount = 1 To Len(tcCode)
lnChecksum = lnChecksum + ASC(Substr(tcCode,lnCount,1))*(1+2*lnCount%2)
Endfor lnCount
Return lnChecksum%10
This check digit would be an additional digit, so either you create a net code of 9 digits plus this check digit or you add it as an 11th digit to the 10 digit code generated earlier. When checking entered codes you'd use one digit less then entered, calculate this digit and verify with the last entered digit.
All in all I think you are asked to apply a certain standard and you should know best what kind of EAN or MSI, CCN, Code39, Code93 or other barcode you should support and then look for official algorithms to generate these and their checksums.
Bye, Olaf.