function isnum(str : string):boolean;
var
i : integer;
begin
result := true;
if length(str) < 1 then exit;
for i := 1 to length(str) do
begin
if (not isnumeric(str[i])) and (str[i] <> #46) then
begin
result := false;
exit;
end;
end;
end;
I, Code: Integer;
begin
{ Get text from TEdit control }
Val(Edit1.Text, I, Code);
{ Error during conversion to integer? }
if Code <> 0 then
MessageDlg('Error at position: ' + IntToStr(Code), mtWarning, [mbOk], 0);
else
Canvas.TextOut(10, 10, 'Value = ' + IntToStr(I));