473,378 Members | 1,375 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,378 software developers and data experts.

IsNumeric function on an empty field.

Simple question...

If you execute a block of statements that uses the IsNumeric function
on a text box that contains no data, will it cause a run time error?
Thanks

looks like this:

If IsNumeric(txtInput.Text) = True Then
MessageBox.Show("Numeric entry found")
Else
MessageBox.Show("Non-numeric entry found", _
"Compound If") :
btnClear.Focus()
End If
I think this could be a possible test question and i just want to
understand what would happen. Thanks!

Sep 23 '06 #1
2 1517
James wrote:
If you execute a block of statements that uses the IsNumeric function
on a text box that contains no data, will it cause a run time error?
Why don't you try it and see?

--

(O)enone
Sep 23 '06 #2
James wrote:
If you execute a block of statements that uses the IsNumeric function
on a text box that contains no data, will it cause a run time error?
Thanks
As Oenone posted, you could have coded this up in about 2 minutes
instead of waiting all this time for a response from someone else. I
know I am guilty of this every once in awhile, but I try to test things
myself first.

In any event, you can also use the TryParse method of most numeric
types to try the conversion.

Sep 25 '06 #3

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

Similar topics

2
by: Joey | last post by:
I am using an import process that scans an html file and exports data to a sql database table. One of the fields I import, on occasion has 2 numeric characters at the very end. For example...
0
by: Daniel Kasak | last post by:
Hi all. I need to test whether the first bit of a field is numeric. For example, the field might contain: 154 boxes I'm currently testing it by doing: if(abs(left(field,locate(' ',...
8
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the...
2
by: Glenn Venzke | last post by:
For some reason all of a sudden number values pulled from a SQL server field with a datatype of "numeric" are not being recognized by asp classic as valid number values. They were previously, but...
4
by: Eugene Anthony | last post by:
I have received the following feedback for the two functions bellow: "The ISNUMERIC test is WORTHLESS for checking for an INT value, because ISNUMERIC will happily accept DOUBLE values, such as...
14
by: Kenny | last post by:
Hello, I would like to know if the function IsNumeric requires a header like #include <iostream> to be functionnal thanks ken
7
by: Nathan Truhan | last post by:
All, I think I may have uncovered a bug in the IsNumeric function, or at least a misunderstanding on functionality. I am writing a Schedule Of Classes Application for our campus and have a...
17
by: MLH | last post by:
I have tested the following in immed window: ?isnumeric(1) True ?isnumeric(1.) True ?isnumeric(1.2) True ?isnumeric(1.2.2)
9
by: bizt | last post by:
Hi, I am using the following function to validate a forms value as an integer function isNumeric(str){ var numericExpression = /^+$/; if(str.match(numericExpression)){ return true; }else{
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.