IsNull Function

測試變數是否包含特殊的 Null 值,此值表示該變數不包含資料。

Returns True when an object variable is passed that does not refer to a valid object, such as a newly created object that has not yet been assigned or an object assigned to the Nothing literal.

語法


IsNull(Var)

傳回值類型

Boolean

參數:

Var:要測試的任意變數。如果該變體型變數包含空值,則函式傳回 True (真),否則傳回 False (假)。

Null - 此值用於沒有有效內容的變體型資料子類型。

錯誤代碼:

5 無效的程序呼叫

示例:


Sub ExampleIsNull
Dim vVar As Variant
    MsgBox IsNull(vVar)
End Sub

Please support us!