Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for existing class
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00061022
Message ID:
00061221
Views:
48
>>>>>>How can I check for the existence of a class? Preferrably a method that searches all available libraries.
>>>>>
>>>>>If you open VCX file that only records with field 'Reserved1'="Class" will contain class name in field 'Objname'.
>>>>
>>>>What I really need the function for is my base smartgrid class, that allows me to specify what class to use for the control for each datatype. I would like a sort of safe guard in the class that chexks for the existence of the class bvefore it attempts to ADDOBJECT. IOW, this would be used at runtime, not at the command window.
>>>
>>>Maybe it's simpler to have app object property-array or INI file etc. containing all available classes, because as I understand you are not going to distribute VCXs separately.
>>
>>I have not tested this exact code but I use similar to find if a class is used to init this object after the form has been init.
>>= AMEMBERS(apname,thisform,2)
>>oldexact=SET("EXACT")
>>IF alen(apname)<>0
>> SET EXACT OFF
>> aptempcnt=alen(apname)
>> FOR i=1 to aptempcnt
>> apcount=ascan(apname,'myclass',1,1)
>> IF apcount<>0
>> you have class
>> else
>> you don't
>> endif
>> =adel(apname,1,1)
>> NEXT
>>ENDIF
>>set exact &oldexact
>
>The problem is that the question was (as I understood it) about adding objects on-fly, i.e. you have nothing to check by AMEMBERS yet.
I guess I missed that.
Jeff

It's Time to get a gun.

That's what I've been thinkin.

I think I can afford one, If I do a little less Drinkin.

www.TrueGeeks.com
Previous
Reply
Map
View

Click here to load this message in the networking platform