Check Sum

Bill Marriott wjm at wjm.org
Mon Apr 23 10:01:53 EDT 2007


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




More information about the use-livecode mailing list