Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for existing class
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00061022
Message ID:
00061217
Vues:
40
>>>>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

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform