|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
IsNumeric function on an empty field.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! James wrote:
> If you execute a block of statements that uses the IsNumeric function Why don't you try it and see?> on a text box that contains no data, will it cause a run time error? -- (O)enone James wrote:
> If you execute a block of statements that uses the IsNumeric function As Oenone posted, you could have coded this up in about 2 minutes> on a text box that contains no data, will it cause a run time error? > Thanks 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. |
|||||||||||||||||||||||