Ok, when nothing is there it says Missing. What can I use in an if statement to check if it's not missing?
like:
VB Code:
sub DoSomething(optional var) if var <> 'missing' then 'dosomething end sub
Printable View
Ok, when nothing is there it says Missing. What can I use in an if statement to check if it's not missing?
like:
VB Code:
sub DoSomething(optional var) if var <> 'missing' then 'dosomething end sub
use Ismissing
if ismissing(var) = true 'argument missing
The one thing I don't try. ;)
Silly VB. :rolleyes:
Thanks. :D
Be aware that IsMissing can only be used for optional variant parameters.
Use default values for other parameter types.
eg.
sub DoSomething(optional aNumber as integer = -1)
if aNumber <> -1 then 'dosomething
end sub
thats a good hint Frans C