IsMissing Function |
Syntax:
IsMissing(expr)
Group:
Description: Returns the True if Optional parameter expr does not have a defaultvalue and it did not get a value. An Optional parameter may be omitted in the Sub, Function or Property call.
Parameters:
Parameter |
Description |
Return True if this variant parameter's argument expression was not specified in the Sub, Function or Property call. |
Example:
Sub Main
Opt 'IsMissing(A)=True
Opt "Hi" 'IsMissing(A)=False
Many 'No args
Many 1,"Hello" 'A(0)=1 A(1)=Hello
OptBye '"Bye"
OptBye "No" '"No"
EndSub
Sub Opt(Optional A)
Debug.Print "IsMissing(A)=";IsMissing(A)
EndSub
Sub Many(ParamArray A())
IfLBound(A) > UBound(A) Then
Debug.Print "No args"
Else
For I = LBound(A) To UBound(A)
Debug.Print "A(" & I & ")=" & A(I) & " ";
Next I
Debug.Print
EndIf
EndSub
Sub OptBye(Optional A As String = "Bye")
Debug.Print A
EndSub