Use the Real value...

Function IsNumber(A:String):Boolean;
Var
  I: Real;
  j: Integer;
Begin
  Val(A,I,j);
  result:=j=0;
End;

This will give the correct result.

Steve Peacocke

At 01:55 p.m. 21/07/2004, you wrote:
Function IsNumber(A:String):Boolean;
Var
  i,j:Integer;
Begin
  Val(A,I,j);
  result:=j=0;
End;

Why is that
IsNumber('A19')=FALSE
while
IsNumber('X19')=TRUE

Val function assumes 'X19' is Hexadecimal.
Can I force it to interpret the parameter as
string? Any clues?

cheers

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to