Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

missing and how to test for it

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
GB
Hi,

If you don't pass an optional argument to a subroutine it comes up as missing. However, if I try the following code

if myArgument is missing I get a debug error. How do I test for this without trying and catching?

Thanks,

Chris
 
Hi Chris,

Try IsMissing(myArgument) - but it only works for variants - typed arguments are initialised automatically.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 



Chris,

Your variable is proabaly a VARIANT. Use the IsMissing function
Code:
...
if ismissing(your_arg) then
...


Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top