Why isnumeric return true?

L

Lasse Edsvik

Hello

one question........ why does isnumeric return true?

a=""
if isnumeric(a) then
response.write("test")
end if

empty isnt numerical is it??
TIA
/Lasse
 
M

Manohar Kamath

Because, the numeric equivalent of a empty string is a numeric zero (not a
string "0").

Historial perspective:
If you know C programming language, the string is always terminated by a
numeric zero (not a string zero). That way, the runtime knows where the
string ends -- since the string is essentially a space in memory.
 
R

Ray Costanzo [MVP]

What version of the Windows Scripting Host do you have installed? That does
not return true for me with version 5.6.

Also, IsNumeric is less than perfect, unfortunately. Check out the caveats
here. (Halfway down the page at the VBScript/Javascript section)
http://www.aspfaq.com/show.asp?id=2390

Ray at work
 
D

David Morgan

Yes, you're better off checking the string is only made up of 0 - 9 as
ABCDEF are numeric also.

E.G. 5F

Regards

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top