Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crash with CONTROL and user defined property
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00824114
Message ID:
00826330
Vues:
23
From my point of view the possibility of using reserved words (all words) is quite unnecessary. For example adding fontbold property to a container based class could seem reasonable for a purpose like storing default fontbold value for all controls placed inside the container. However, coding in such way leads to problems because name is the same but meaning (intent) of the fontbold property of the container is quite different than meaning of fontbold property of a label. In this example better seems to use name as DefaultFontBold. DefaultFontBold name clearly tells what is the property for. I think that using of reserved words is resonable only in case of VFP shortcomings or inconsistencies like lack of refresh method in label control (before VFP8). But even in such case it seems to me that better is to use a word that is not reserved.



>From a practical standpoint, I have seen the most risk in using reserved words when adding custom properties or methods to objects when those names are valid property or method names for other vfp objects. Adding a FontBold prop to an object based on the Control class would be an example, as this is a valid prop name for other classes.
>
>>Thanks Jim ! Now it is much more clear for me. I must say that I have no problems with using reserved word as a name. I just try do not use such words as name (with two exception refresh and release) so I don't have problems with them. As regards as VFP behaviour for me it is OK. I think that a sentence in VFP help like "use reserved words on your own risk" or "use and enyoy" or "now you can use but in future it can change" or similar would be enough.
>>
>>
>>>Current behavior is this: "quietly let use the word as a property name"
>>>
>>>Either of these would be an enhancement request:
>>>- should generate warning about using reserved word and let use the word as a property name.
>>>- should generate error message and do not let use the word as a property name
>>>
>>>
>>>I think the warning idea has some merit. You could post this over to the VFP Wish List.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform