function IsNumber(s:string);Boolean;
begin
Result:=Length(s)=9;
if Result then
for i:=low(S) to hi(s) do
if not(s[i] in ['0'..'9']) then Result:=false;
end;
有些错误更正
var
i:integer;
t,astring : string;// to be test;
begin
if length(astring) = 9 then
begin
for i:= 1 to length(astring) do
begin
t:= copy(astring,i,1);
if pos(t,'0123456789')=0 then
begin
showmessage('Error');
break;
end;
end;
end;
end;