Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing if an object is an instance of a class
Message
De
07/10/2005 05:47:32
 
 
À
07/10/2005 05:33:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01057071
Message ID:
01057082
Vues:
13
In case anybody wants it too :
FUNCTION InstanceOf
	LPARAMETERS oObject,cClassName
	LOCAL laClassHierarchy,lcClassName,llResult
	DIMENSION laClassHierarchy[1]
	IF VARTYPE(oObject)!="O"
		MyError("Parameter oObject must be of object type")
	ENDIF
	IF VARTYPE(cClassName)!="C"
		MyError("Parameter cClassName must be of character type")
	ENDIF
	lcClassName=UPPER(cClassName)
	ACLASS(laClassHierarchy,oObject)
	IF ASCAN(laClassHierarchy,lcClassName)>0
		llResult=.T.
	ELSE
		llResult=.F.
	ENDIF
	RETURN llResult
ENDFUNC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform