Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining whether a control exists.
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00453834
Message ID:
00453976
Views:
21
Well, I had a problem not so far ago with use of type() function everywhere. With a single use - no problem, but when you have tonnes of codes and many places with type() function, preformance in such case goes out of real scope of usual attention. After we replaced all type() by PEMSTATUS() and VARTYPE() - application much faster!

As about objects that are not referenced by other objects - these are global objects and there are no much of them in any good application, so no much overhead here.

My good practice and experiense is to use vartype() and PEMSTATUS() everywhere I can. This problem is much similar to problem with use '()' vs '&'.

>Vlad,
>
>Yes I use the TYPE() function for it. I don't care about .001 versus .006 for a single line of code that is not in a loop. I don't even care if it is in a loop until the loop count gets up to a few thousand iterations.
>
>PEMSTATUS() has had problems with object references not being released in the past so I took a different approach and haven't seen any need to change it yet. TYPE() also works for checking objects that are not part of the PEMs of another object so it is universal for checking the existance of an object. The only baseclass that my approach doesn't work for is the SCATTER NAME (because the object doesn't necessarily have a property named Name) and some COM objects (I handle COM objects differently anyway).
>
>I do use PEMStatus() for other things though.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform