Documentation
Back to website >

Modulo10 (Pascalscript)

Description

Modulo10 forms the check digit according to the Modulo10 method.

Syntax

function Modulo10(const S: String): Integer;

Arguments

Modulo10 forms a check digit according to the Modulo10 method. S contains the string whose check digit is to be formed. Modulo10 is especially used by banks to create machine-readable documents.

Example

var
  S1: String;
  i : Integer;
  S2: String;
begin
  S1:='123456';
  i:=Modulo10(S1);
  S2:=IntToStr(i);
  ShowMessage(S2);
end;

Rules to understand the script can be found here.

The text '123456' is assigned to the string variable S1. The function Modulo10 forms the check digit and assigns it to the variable i. IntToStr converts the integer value i into a displayable text S2.

ShowMessage shows: 6