Is functions


Function nameVB 6VBAVBScriptVB.NETT-SQL
IsArray
IsDate
IsDBNull
IsEmpty
IsError
IsMissing
IsNothing
IsNull
IsNumeric
IsObject
IsReference

The Is functions are a set of functions in Microsoft's Visual Basic 6, Visual Basic for Applications, VBScript, and Visual Basic.NET. Several of them are also provided in Transact-SQL by the.NET Framework Data Provider for Microsoft SQL Server.

What the functions do

The functions are simple data validation and data type checking functions. The data validation functions determine whether it is possible to convert or coerce the data value given as an argument to the function to the type implied by the function name, and return a Boolean value recording whether it was possible or not. True indicates that conversion would be possible, False indicates that it would not be. Similarly the type checking functions return a Boolean recording whether the argument expression is of a particular type.
In Transact-SQL, the functions return zero or one rather than Boolean values True and False.
;IsArray
;IsDate
;IsDBNull
;IsEmpty
;IsError
;IsMissing
;IsNothing
Return
End Function The effect of this is to return False for all value expressions, because they will be wrapped up, as part of the function call, into objects, which will by their very natures, not be null objects. To avoid this behaviour, one can use the IS operator to compare an object directly to Nothing, writing expression IS Nothing rather than IsNothing. The compiler will raise a compile-time error if the compared expression is a value rather than a reference type, catching the type mismatch at compile time rather than simply returning False at run-time. Strings are reference types in Visual Basic.NET, and so capable of being null. For such strings, this function returns True.
;IsNull
;IsNull
;IsNumeric
;IsObject
;IsReference

What supports what

Microsoft's on-line documentation