Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing property of Class
Message
 
 
À
08/09/2001 19:45:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00554263
Message ID:
00554342
Vues:
7
You can create a table and store properties value there and in the Load of the base class just transfer them into object properties. Something like
* Table 'myproperties' structure: 
Classname    C(32)
PropertyName C(32)
PropertyValue C(60)
******

...

* Base class Load
SELECT 0
USE myproperties 
SCAN FOR Classname = This.Class
  STORE EVAL(TRIM(PropertyValue) ) TO ("This." + Trim(PropertyName))
ENDSCAN
USE
....
* In the form 'SomeMethod'
SELECT 0
USE myproperties 
  * Find a property. You can use SEEK here
  LOCATE FOR Classname = This.Class AND PropertyName = "SOMEPROPERTY"
  IF NOT FOUND()
    APPEND BLANK
    REPLACE Classname WITH This.Class, ;
            PropertyName WITH "SOMEPROPERTY"
  ENDIF
  REPLACE PropertyValue WITH TRANSFORM( THIS.someproperty)

USE
This code isn't complete or tested and just illustrates my idea.

>Do you know another way?
>
>>AFIAK it's not possible. What're you trying to achieve? Maybe there's another way to get the same result.
>>
>>>Yes. Is it possible?
>>>
>>>>Let's clarify it, you want to change a property of a parent class from child class (form) method in runtime, Correct?
>>>>
>>>>>I want to change property of Class from the method of Form that has been created from Class.
>>>>>
>>>>>
>>>>>>Find this property in the Properties sheet in Class Designer and type a new value.
>>>>>>
>>>>>>>I know how to change property value of Form, but I want to change the property of class, so that any Form created from some Class inherit the same property value.
>>>>>>>
>>>>>>>
>>>>>>< SNIP >
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform