Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: Set class's Name change the object's Class property
Message
From
06/12/2007 09:12:34
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
06/12/2007 08:13:53
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01273530
Message ID:
01273563
Views:
13
Fabio,
yes, I know. It is usefull for memberclasses - and to protect some classes from reuse. (<g>)

I know of it, but since it is a non documented feature I've skiped using it.
Agnes
>Agnes,
>
>you can use every trick, but this is an insect in environment of OOP quite defined.
>
>A lot of VFP commands lose consistency
>
>Example:
>
>CLEAR
>
>z=CREATEOBJECT("ClassName")
>
>* VFP known a Class
>? AMEMBERS(AP,z.Class)
>
>* but it cannot create a Class object !!!!
>k=CREATEOBJECT(z.class)
>
>
>DEFINE CLASS ClassName	AS Custom
>	Name	= 'ObjectName'
>
>   PROCEDURE Init
>	? "Class expected <ClassName>, Observed :"	,this.Class
>        * this not set Class
>	this.Name = "AnotherName"
>	? "Class expected <ClassName>, Observed :"	,this.Class
>ENDDEFINE
>
>
>
>>Fabio,
>>
>>Please this is a feature.
>>I use this one down the days where we start with the memberclass* stuff. (There must be an old thread of this)
>>
>>This one allows you to subclass a member like optionbutton but keep the names like Option1, Option2 .. instead of something strange like myopt1 or so.
>>
>>See example
>>
>>CLEAR
>>
>>=CREATEOBJECT("mygroup")
>>=CREATEOBJECT("mygroup2")
>>
>>DEFINE CLASS MyOpt	AS OPTIONBUTTON
>> NAME = 'MyOpt'
>>ENDDEFINE &&MyOpt	AS OPTIONBUTTON
>>
>>
>>DEFINE CLASS MyOpt2	AS OPTIONBUTTON
>> NAME	= 'Option'
>>ENDDEFINE &&MyOpt2	AS OPTIONBUTTON
>>
>>DEFINE CLASS mygroup AS OPTIONGROUP
>> MEMBERCLASS = 'MyOpt'
>> MEMBERCLASSLIBRARY = THIS.CLASSLIBRARY
>>
>> BUTTONCOUNT = 0
>>
>> PROCEDURE INIT
>>  THIS.BUTTONCOUNT = 2
>>  ?THIS.CLASS,THIS.OBJECTS(1).NAME
>> ENDPROC &&mygroup.init
>>ENDDEFINE &&mygroup as optiongroup
>>
>>DEFINE CLASS mygroup2 AS OPTIONGROUP
>> MEMBERCLASS = 'MyOpt2'
>> MEMBERCLASSLIBRARY = THIS.CLASSLIBRARY
>>
>> BUTTONCOUNT = 0
>>
>> PROCEDURE INIT
>>  THIS.BUTTONCOUNT = 2
>>  ?THIS.CLASS,THIS.OBJECTS(1).NAME
>> ENDPROC &&mygroup2.init
>>ENDDEFINE &&mygroup as optiongroup
>>
>>
>>Sp you can mimic your member* stuff in existing classes. O.K.?
>>
>>HTH
>>Agnes
>>>Set the Name property into a class definition change it's Class property to the name value.
>>>
>>>
>>>CLEAR
>>>
>>>=CREATEOBJECT("ClassName")
>>>
>>>DEFINE CLASS ClassName	AS Custom
>>>	Name	= 'ObjectName'
>>>
>>>   PROCEDURE Init
>>>	? "Class expected <ClassName>, Observed :"	,this.Class
>>>        * this not set Class
>>>	this.Name = "AnotherName"
>>>	? "Class expected <ClassName>, Observed :"	,this.Class
>>>ENDDEFINE
>>>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform