473,804 Members | 3,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(txtIn put.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 1544
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
1408
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 "thename 04". What I need to do is delete those numeric characters, if they exist. I thought about something like this: if isnumeric(right(thename,2))=TRUE then
0
5701
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(' ', field))>0),'Numeric bit at front', 'Not
8
2325
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 following function in a validating class to use when needed. (Value = H880118A gave the error (like other 'unconvertible' strings)) Public Function Numeric(ByVal value) As Boolean
2
2016
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 now are not. When I use the "IsNumeric" function, it returns false. When I try to Ctype it to an integer, I get an "overflow" error. If I change the datatype of the database field to "int", it works fine. Whats the deal? The values I'm working with...
4
13276
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 89.11998811777 and other values that are simply *NOT* INT values." <% function isZip(input)
14
40148
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
2386
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 section that lists the Times, Buildings and rooms for courses. In this section I have a function called PadCell that takes3 parameters, one the value, one a padd count and one a a boolean input called StripNumeric, that if true, checks if the value...
17
2302
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
4169
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{
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.