### Title

Calculate control sum

### Post

I need to calculate a control number. As a function.

Its using the modulus 10 method with the weights 2 and 1. Example:

860324-0261 this is a 9 digit number with a 10th control number (=1).

212121 212 factorize with these numbers.

16,6,0,3,4,4,0,2,12 will give theses results

1+6+6+0+3+4+4+0+2+1+2 = 29. 9 is the last digit. 10-9=1. Control number is 1. Function would return true, since its correct. If the input number is anything else than 10 digits after stripping away the dash it shall also return false.

So, with php I would know how to do, but FileMaker functions can't contain loops. Anyone have an idea?

Are you converting isbn10 to isbn13? I did app last year for someone than converts isbn10 to isbn13 and isdn13 to isdn 10. It uses a formual similar to the above. My solution isn't pretty by any means but it get the job done. In any manner maybe this sample app will help you figure out your answer.

https://www.sugarsync.com/pf/D9559058_790_868748394