Wenn's denn sein muß ... 'nen einfachen ISBN(10)-Check hab'sch och noch bei mir rumliegen ._.
Delphi-Quellcode:
Function IsValidISBN(S: AnsiString): ByteBool;
Var M, C, i: Integer;
Begin
Result := False;
If _Length(S) < 10
then Exit;
M := 10;
C := 0;
For i := _Length(S)
downto 1
do
If (M = 10)
and (S[i]
in ['
x', '
X'])
Then Begin
Inc(C, 100);
Dec(M);
End Else If S[i]
in ['
0'..'
9']
Then Begin
If M = 0
Then Exit;
Inc(C, M * (Ord(S[i]) - Ord('
0')));
Dec(M);
End Else If not (S[i]
in ['
', '
-'])
Then Exit;
If M > 0
then Exit;
Result := C
mod 11 = 0;
End;