and within this method I want to check and see which one
of these arguments have been set by the client of the
method and which ones have not.
Do I use IsNothing for the Collection, IsNull for the
MyObject, and IsEmpty for the primitive String ?
Thanks.
You can test the collection and the object for Nothing as in "If arg2 Is
Nothing Then" but the only thing you can check on the string would be "If
Len(arg1)=0 Then" since a string can not be Empty, Nothing or Null. If you
want to be able to check for arguments not being passed at all you must make
the all Optional and type them as Variants and then you can use the
IsMissing() function to see what was actually passed by the client. You
then also have to check the actual type since they can pass anything in to a
Variant argument.
IsNull to verify whether or not the one expression contains NULL.
IsObject to verify whether or not one expression is the vbObject type.
IsEmpty to verify whether or not one expression has been initialized.
You can select according to your own situation. Besides, you can also
consider using other possible ways for example check the length or the
string variable, the count proper of collection and etc.
Hope this helps,
Robin