Guest User

Untitled

a guest
Jun 21st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. function isbncheck(isbncheck:STRING):STRING;
  2. var pruef_summe,pp,j,k,ascii:INTEGER;
  3. divi:REAL;
  4. begin
  5. k:=10;
  6. ascii:=0;
  7. pruef_summe:=0;
  8. pp:=strtoint(isbncheck[10]);
  9. for j:=1 to 9 do
  10. begin
  11. case ord(isbncheck[j]) of
  12. 48: ascii:=0;
  13. 49: ascii:=1;
  14. 50: ascii:=2;
  15. 51: ascii:=3;
  16. 52: ascii:=4;
  17. 53: ascii:=5;
  18. 54: ascii:=6;
  19. 55: ascii:=7;
  20. 56: ascii:=8;
  21. 57: ascii:=9;
  22. else showmessage(inttostr(ord(isbncheck[j])));
  23. end;
  24. pruef_summe:=pruef_summe + (ascii*k);
  25. k:=k-1;
  26. end;
  27. divi:=pruef_summe mod 11;
  28. if 11-divi=10 then pp:=0;
  29. if 11-divi=11 then pp:=1;
  30. if 11-divi=pp then Result:='korrekt'
  31. else Result:='fehlerhaft';
  32. end;
Add Comment
Please, Sign In to add comment