CheckDigit Routing Number using Nav 2009R2

Hi every Navison's can help 

am workin in navision 2009R2 noh america version ,and my project it is to export electonic payment , so my codeunit it work and report which run the codeunit , my probleme when export payment the field (Routing Number ) the routing field number must be calculated or checked by the checkdigit method, the latter does not work, I do not know why and how I call this function to apply to the fields, this is copy to my code function and the line of routing number : 

the routing field number must be calculated or checked by the checkdigit method, the latter does not work, I do not know why and how I call this function to apply to the fields


Weight := '37137137';
Digit := 0;

IF STRLEN(DigitString) <= STRLEN(Weight) THEN
EXIT(FALSE);

FOR I := 1 TO STRLEN(Weight) DO BEGIN
EVALUATE(Digit1,COPYSTR(DigitString,I,1));
EVALUATE(Digit2,COPYSTR(Weight,I,1));
Digit := Digit + Digit1 * Digit2;
END;

Digit := 10 - Digit MOD 10;
IF Digit = 10 THEN
CheckChar := '0'
ELSE
CheckChar := FORMAT(Digit);
EXIT(DigitString[STRLEN(Weight)+1] = CheckChar[1]);

Related
Recommended