Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: scope resolution and HIDDEN properties
Message
 
À
16/02/2005 10:42:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00987452
Message ID:
00987822
Vues:
39
Hi Fabio,

class::methods() is'n not 100% equal to DODEFAULT(). But maybe is bug.
Example 2 always return class "_custom" but class::method() don't see hidden properties. Example 1 shows another using :: Scope Resolution Operator...

Example 1:
clear
loCont=CreateObject("_container")
loCont.Call()
?
loCont.AddObject("c1","_custom")
loCont.C1.Call()

define class  _container as Container
   name="_container"

   procedure call()
     ?"Container.Call()"
     ?This.Class
   endproc

enddefine


define class  _custom as custom
   name="_custom"

   procedure call()
     ?"Custom.Call()"
     ?This.Class
     =_container::Call()
   endproc

enddefine
Example 2:
clear
loCont=CreateObject("_custom")
loCont.Call()
?

define class  _container as Container
   name="_container"

   procedure call()
     ?This.Class
   endproc

enddefine

define class  _custom as _container
   name="_custom"

   procedure call()
     ?"DODEFAULT()"
     =DODEFAULT()
     ?"Custom.Call()"
     =_container::Call()
   endproc

enddefine
MartinJ

>Scope resolution don't see hidden properties.
>
>Then, I cannot call the sub-subclass methods, and OOP is corrupted.
>
>repro
>
>CLEAR
>ON ERROR ?? MESSAGE()
>WITH CREATEOBJECT("vfpClassesAreBug1")
>	.CALL
>ENDWITH
>ON ERROR
>
>
>DEFINE CLASS vfpClassesAreBug1 as ScopeResolutionBUG
>	PROCEDURE call
>		? "SCOPE RESOLUTION		"
>		ScopeResolutionBUG::call()
>		? "DODEFAULT			"
>		DODEFAULT()		
>	ENDPROC
>ENDDEFINE
>
>DEFINE CLASS ScopeResolutionBUG  as custom
>	hiddenproperty = 1
>	
>	HIDDEN hiddenproperty
>	
>	PROCEDURE call
>		?? this.hiddenproperty
>	ENDPROC
>ENDDEFINE
>
>
>Fabio
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform