OK, got my Sesame back again......
I made the correct syntax changes to my earlier "single formula" code Reply #8, 04/26/05, 22:53, EDT.
It appears to be working OK, for the one number you provided..
var vTestString as String // test number)
var vDigit9 as Int //(should match last digit of test number)
vTestString = @PromptForUserInput("Enter 8 digits to test","17065761")
vDigit9 = 10 - @Mod (
@TN(@Mid(vTestString,1,1)) +
@TN(@Mid(vTestString,3,1)) +
@TN(@Mid(vTestString,5,1)) +
@TN(@Mid(vTestString,7,1)) +
@Int(@TN(@Mid(vTestString,2,1))*2 /10) +
@Mod(@TN(@Mid(vTestString,2,1))*2,10) +
@Int(@TN(@Mid(vTestString,4,1))*2 /10) +
@Mod(@TN(@Mid(vTestString,4,1))*2,10) +
@Int(@TN(@Mid(vTestString,6,1))*2 /10) +
@Mod(@TN(@Mid(vTestString,6,1))*2,10) +
@Int(@TN(@Mid(vTestString,8,1))*2 /10) +
@Mod(@TN(@Mid(vTestString,8,1))*2,10), 10)
@MsgBox("Last digit after " + vTestString," should be a " + vDigit9,"")
If I had more time, I would take the 9 digit input and compare the result against the last digit.
Do you think you could provide me with a dozen or so 9 digit numbers that I can test? Too lazy to go through the manual process of validation (Obviously why you needed this automated).
Again, there is only one number variable that is Int, but there are 12 times a String is converted to a Number, and 4 times the Integer value is calculated, and 4 times the modulo value is calculated. Still curious to see if the Int/Double problem shows up in this format.
-------------------
Edited to change from *2,10 and *2/10 to *10,2 and *10/2 on the last 8 lines of the central core in the code above.