ISO 7064/fr
English · Français
La norme ISO 7064 spécifie un ensemble de systèmes de caractères de contrôle capable de protéger des chaînes contre les erreurs de saisie.
Fonction StrMOD97
La fonction StrMOD97 peut encoder et vérifier la somme de contrôle selon ISO 7064 mode 97 10.
function StrMOD97( s :String):integer;
const
modu = 97;
var
sx :String;
isx,ic,p:Integer;
begin
p := Length( s );
while( p > 9 ) do
begin
sx := Copy( s, 1, 9 );
Delete( s, 1, 9 );
isx := StrToInt( sx );
ic := isx mod modu;
s := IntToStr( ic ) + s;
p := Length( s );
end;
isx := StrToInt( s );
if isx >= modu
then ic := isx mod modu
else ic := isx;
result := ic;
end;From the Free Pascal wiki, page "ISO 7064/fr", as it stood on 2020-02-18 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.