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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Examining object variables

Status
Not open for further replies.

catalina36

Programmer
Aug 28, 2000
36
US
Is there any way to determine if an object variable points to an instantiated object? Presently I’m trapping the Error 91, however I would like to employ a more proactive approach.

Thanks for helping a beginner.
[sig][/sig]
 
Hiya,

yes, there is. If an object variable doesn't point to an instantiated object, it points to NOTHING, so you can do this:

If ObjectVariable is nothing then

alternatively, you can do the following:

rc = typename(ObjectVariable)

and, if the object variable doesn't point to anything, rc will become equal to EMPTY

The first way's the best way, though (in my opinion).


Cheerio,

Paul [sig][/sig]
 
Paul,

Thanks for the great solutions. I like the first approach the best as well!

Jon
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top