Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine existence of objects (Outlook, custom App obje
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00428456
Message ID:
00430122
Views:
19
Thanks Ed for the clarification. I must have misinterpreted a previous post some weeks ago when someone else was discussing this topic.

Simon


>>You should use Type("oSwitch")=="O" not VarType(oSwitch).
>>
>
>That's bad thinking - VarType() works fine for checking object existances; it only smokes if you try checking a property or method of a non-existant object. VarType() is considerably faster than Type(), and if you know what you're doing using it is quite acceptable, and often preferable, since it differentiates between operable objects and nulled object refs without a separate IsNull() call.
>
>>Simon
>>
>>>>I have a couple of questions that probably have simple answer (hence, I couldn't figure them out myself :).
>>>>
>>>>1. I have error handling in my app that prints a report in the event of an unhandled error and then gracefully shots down the app. I would like to have the error report e-mailed to us if the user has Outlook. I know how to handle the e-mail peice, but I would like to check for the existence of Microsoft Outlook on a users P.C. - if they have Outlook, an e-mail is fired off - if not, a report is printed that would have to be faxed to us. How would I check to see if Outlook is intalled on the workstation? (I would have tried a few things here before posting this - except that all our internal P.C.'s have Outlook.)
>>>
>>>Probably the best (IMO) way to do this is try to create the object and trap the failure error. This will determine if its on the system and if its installed correctly so you can access it.
>>>>
>>>>2. I also have an application object with its own custom properties. How would I check to determine if the application object (named: oSWITCH) is active in memory?
>>>
>>>Check out VARTYPE(myvariable) in the VFP help.
Simon White
dCipher Computing
Previous
Reply
Map
View

Click here to load this message in the networking platform