alphanumeric vs. numeric

Post Reply
User avatar
Iris Gesser
Posts: 32
Joined: Fri Apr 22, 2016 10:19 pm

alphanumeric vs. numeric

Post by Iris Gesser »

Hello,

can you help me please?
I have to find out if a character variable inside is alphanumeric or numeric.
Is there an easy command, that I can use?

Thank you in advance, kind regards
Iris
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: alphanumeric vs. numeric

Post by ukoenig »

Hallo Iris,
I have to find out if a character variable inside is alphanumeric or numeric.
VAL returns the info You are looking for

Msgalert( VAL( "aaa" ) ) = 0
Msgalert( VAL( "111" ) ) = 111

best regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Iris Gesser
Posts: 32
Joined: Fri Apr 22, 2016 10:19 pm

Re: alphanumeric vs. numeric

Post by Iris Gesser »

Hello Uwe,

thank you for your answer.
I have tried with VAL, but this is not the solution.

local cNumber = "1S2673Z"
msginfo(VAL(cNumber)) = 1

I think VAL evaluates cNumber until the first non-numeric character.

Thank you and kind regards
Iris
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Re: alphanumeric vs. numeric

Post by Natter »

cVar:="a5b"
posrange(chr(48), chr(57), cVar) - 2
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: alphanumeric vs. numeric

Post by cnavarro »

Try with

Code: Select all

   ? hb_IsNumeric( <var> )
 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Iris Gesser
Posts: 32
Joined: Fri Apr 22, 2016 10:19 pm

Re: alphanumeric vs. numeric

Post by Iris Gesser »

Thank you very much, this is wotking fine!
Kind regards
Iris
Post Reply