Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I know at runtime if a class is defined
Message
From
09/03/2004 01:21:51
 
 
To
09/03/2004 00:12:22
James Chan
Objectmastery Pty Ltd
Hawthorn, Australia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00884319
Message ID:
00884329
Views:
15
I'm not sure what you are asking. See if AINSTANCE() or AVCXCLASSES( ) will help you. If you don't know if newclass exists, you may have to set ON ERROR before CREATEOBJECT() then check to see if the object was created then reset on error.




>Is there any function like
IsDefined("MyClass")
that tells me if MyClass is defined? I need this function in a loop where the class name is constructed at runtime and, if defined, an object will be instantiated. e.g.
>
>for Loop = 1 to MaxClass
>  NewClass = ConstructClassName(Loop)
>  if IsDefined(NewClass)
>    oObject = CreateObject(NewClass)
>    * do something
>  end
>endfor
>
>
>Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform