JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Checking Data Types

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.

Table 2.6: Type checking functions.

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 IfElse Statements" in this chapter for more details.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor