The information in this article applies to:
SUMMARYIn Microsoft Visual Basic Programming System, Applications Edition, when you use the CInt() function with a string that cannot be converted to a number, you receive the following error message:
MORE INFORMATION
The CInt function converts an expression to an integer. You can use any
valid numeric or string expression, but the string expression must be able
to be converted to a number. The Visual Basic Reference states that you
should use the CInt function instead of the Val function to provide
internationally aware conversions from any other data type to Integer.
However, the two functions do not behave exactly the same.
Because the Val function returns the value 0 when used with an expression
that contains either 0 or no numbers at all, you cannot use it to test
whether an input string is a valid number. You can, however, use the CInt function in a procedure to determine whether an input string is a valid number.
REFERENCESFor more information about the CInt Function, choose the Search button in the Visual Basic Reference and type: CInt Additional query words: W_eXcel
Keywords : |
Last Reviewed: October 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |