473,379 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Why isnumeric return true?

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
Jul 19 '05 #1
3 7224
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.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:Ok**************@TK2MSFTNGP11.phx.gbl...
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

Jul 19 '05 #2
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
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:Ok**************@TK2MSFTNGP11.phx.gbl...
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

Jul 19 '05 #3
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
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:uc****************@TK2MSFTNGP10.phx.gbl...
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
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:Ok**************@TK2MSFTNGP11.phx.gbl...
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


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tom Dauria | last post by:
I have a SQL database with an Access front end. In the database I have a read only and a read write role. When a read only user opens the database I want all the fields on the form to be locked...
5
by: w i l l | last post by:
Why does this work the way it does? If someone could explain return true, and return false to me I'd greatly appreciate it. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ...
6
by: RitaG | last post by:
Hi. I have a Sub that calls a Boolean Function and exits the Sub if the Return value is False. The problem is it's exiting the Sub even if the Return value is True. Here's my code. Private...
3
by: Alpha | last post by:
Hi, I have a window C# application. I update the dataset when user finished entering in a text box. But when I want to update the database when OK is pressed, the...
0
by: Andreas Klemt | last post by:
Hello, I have this Protected Overrides Function OnBubbleEvent(ByVal source As Object, ByVal args As System.EventArgs) As Boolean a) Return True b) Return False c) Doing nothing... End...
2
by: BerkshireGuy | last post by:
I have the following union query that works great, but I want to alter the query to only return True (-1) for the TEST column. Currently the test column DOES return 0 or -1. I just want the -1....
7
by: moltendorf | last post by:
Okay... so I'm generating a custom Slideshow tool for my friend... and I never seem to get any replies from Webberdev, so here I am, posting on a completely new forum... Anyways, the code is here:...
4
by: cssExp | last post by:
hello, i want to check for errors on submitting a form, on encountering an error it runs a function and returns a false preventing form submit. I have implemented that. function eCheck() { ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.