Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IsNumeric 1

Status
Not open for further replies.

steelydon

Programmer
Aug 22, 2001
2
GB
Does Delphi 5 contain an equivalent to the VB "IsNumeric" function, or can anyone help with how I test whether a certain character in a string is a numeric or an alpha?
 
hi steelydon,

What does IsNumeric do? Maybe I can help you then ...

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
Be a nice guy 'n press that little ol'
VVV---(this one) for me ;-)
 
There are a number of ways to test it. One of them is the val procedure

for further information check out faq218-360 in the pascal-forum about strings


Val( TextVal, Number , Code) converts a string to a number.
If this is possible the result of code = 0, other wise code indicates the character where
the error occured

example:

Textval := '354';
Val(Textval, Number, Code) ---> Code = 0, Number = 354

Textval := '37645x2';
Val( Textval, Number, Code) ---> Code = 6, Number remains unchanged;

Regards
S. van Els
SAvanEls@cq-link.sr
 
Thanks S. van Els - the Val procedure did the job
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top