Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: scope resolution and HIDDEN properties
Message
 
To
16/02/2005 10:42:38
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00987452
Message ID:
00987822
Views:
42
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
Previous
Reply
Map
View

Click here to load this message in the networking platform