Subject: [DUG]: Numeric test
From: "Sergei Stenkov" <[email-masked]>
To: Multiple recipients of list delphi <[email-masked]>
Date: Tue, 20 Mar 2001 12:42:20 +1100

Hello,

I wonder if there is a built-in function or a better way to test a string to
see if its value is numeric then this:

function IsNumeric(sTemp: String; var bInteger: Boolean): Boolean;
begin
    Result := True;

    try
      StrToInt(sTemp);
      bInteger := True;
    except
      on E:EConvertError do begin
        try
          StrToFloat(sTemp);
          bInteger := False;
        except
          on E:EConvertError do begin
            Result := False;
          end;
        end;
      end;
    end;
end;

How do I suppress error messages generated by StrTo... so that they do not
show up.
I've tried setting NoErrMsg := True but it doesn't work with this function.

Thank you,
Sergei Stenkov

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [email-masked]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [email-masked] 
with body of "unsubscribe delphi"