Hi guys,
I need to make a checksum procedure. Can someone help me?
I have a 15 digit number:
Num:=220840001229500
The last 2 digits are zeroes by default.
To get a "control number" I have to perform the following calculation:
I divide Num with 97, thats:
220840001229500:97=2276701043603.09xxxx
Now I have to use the second digit of this result - the 9.
(97+1)-9=89
So 89 is my "control number",
and now at the end, Num: the last 2 zeroes get replaced with the "control number" and Num2: would be
Num2:=2208400012295/89
Greetings, Blash
Num := 220840001229500;
rTemp := Num / 97;
iDigit := TRUNC(ABS(FRAC(rTemp)) * 100) DIV 10;
iDigit := (97 + 1) - iDigit;
Num2 := (Num DIV 100) * 100 + iDigit;
You will need to declare Num and Num2 as Int64 variables (Longint ain't big enough)
The Neil =:)