Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isbncheck(isbncheck:STRING):STRING;
- var pruef_summe,pp,j,k,ascii:INTEGER;
- divi:REAL;
- begin
- k:=10;
- ascii:=0;
- pruef_summe:=0;
- pp:=strtoint(isbncheck[10]);
- for j:=1 to 9 do
- begin
- case ord(isbncheck[j]) of
- 48: ascii:=0;
- 49: ascii:=1;
- 50: ascii:=2;
- 51: ascii:=3;
- 52: ascii:=4;
- 53: ascii:=5;
- 54: ascii:=6;
- 55: ascii:=7;
- 56: ascii:=8;
- 57: ascii:=9;
- else showmessage(inttostr(ord(isbncheck[j])));
- end;
- pruef_summe:=pruef_summe + (ascii*k);
- k:=k-1;
- end;
- divi:=pruef_summe mod 11;
- if 11-divi=10 then pp:=0;
- if 11-divi=11 then pp:=1;
- if 11-divi=pp then Result:='korrekt'
- else Result:='fehlerhaft';
- end;
Add Comment
Please, Sign In to add comment