make that
return the last char of (10 - ( x mod 10 ))
----------
function upcCheck pValue
repeat with i = 1 to the length of pValue step 2
add char i of pValue to x
end repeat
multiply x by 3
repeat with i = 2 to the length of pValue step 2
add char i of pValue to x
end repeat
return the last char of (10 - ( x mod 10 ))
end upcCheck