function IsNumber(N : String) : Boolean;
var
I : Integer;
begin
Result := True;
if Trim(N) = '' then
Exit(False);
if (Length(Trim(N)) > 1) and (Trim(N)[1] = '0') then
Exit(False);
for I := 1 to Length(N) do
begin
if not (N[I] in ['0'..'9']) then
begin
Result := False;
Break;
end;
end;
var avalue:string;
isn:boolean;
begin
avalue:=inputbox ('test1','test2','');
isn:=isnumber(avalue);
if isn=true then
showmessage('yes')
else
showmessage('no');
end;
برچسب : نویسنده : bmypedia3 بازدید : 255