By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,805 Members | 1,653 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,805 IT Pros & Developers. It's quick & easy.

IsNumeric function on an empty field.

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.