![]() ![]() | ||
Visual Basic has a number of data verification functions, which appear in Table 2.6, and you can use these functions to interrogate objects and determine their types.
Function |
Does this |
---|---|
IsArray() |
Returns True if passed an array |
IsDate() |
Returns True if passed a date |
IsDBNull() |
Returns True if passed a database NULL value; that is, a System.DBNull value |
IsError() |
Returns True if passed an error value |
IsNumeric() |
Returns True if passed an numeric value |
IsReference() |
Returns True if passed an Object variable that has no object assigned to it; otherwise, returns False |
Tip |
You can also use the TypeOf keyword to get the type of an object like this: If (TypeOf Err.GetException() Is OverflowException) Then…. See "Making Decisions with If…Else Statements" in this chapter for more details. |
![]() ![]() | ||