Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Child class in code does not contain method from parent
Message
De
17/06/2004 04:19:15
 
 
À
16/06/2004 21:52:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00914483
Message ID:
00914545
Vues:
11
Hi,

shouldn't be a problem. What overriding in vfp is, should become clear now:
local li
lo = CREATEOBJECT("overSuper")
lo = CREATEOBJECT("SubSub")
lo = CREATEOBJECT("SubDoDef")
lo = CREATEOBJECT("SubEmpty")
lo = CREATEOBJECT("SubComm")
lo = CREATEOBJECT("SubDef_in")
lo = CREATEOBJECT("SubDef_out")


DEFINE CLASS oversuper as Custom
	lFlag = .f.
	FUNCTION init
		this.lFlag = .t.
	ENDFUNC

	FUNCTION destroy
		? PADR(this.Class, 12) + ;
			IIF(this.lFlag, "All Ok", "has a problem")
	endfunc
ENDDEFINE

DEFINE CLASS subSub as oversuper
	FUNCTION init
		RETURN DODEFAULT()
	endfunc
ENDDEFINE

DEFINE CLASS subDoDef as oversuper
	FUNCTION init
		RETURN DODEFAULT()
	endfunc
ENDDEFINE

DEFINE CLASS subEmpty as oversuper
	FUNCTION init
	endfunc
ENDDEFINE

DEFINE CLASS subComm as oversuper
	FUNCTION init
		*
	endfunc
ENDDEFINE

DEFINE CLASS subdef_in as oversuper
	FUNCTION init
		#if .f.
		#endif
	endfunc
ENDDEFINE

DEFINE CLASS subdef_out as oversuper
	#if .f.
		FUNCTION init
		endfunc
	#endif
enddefine
HTH

thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform