Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default Property of an object
Message
De
31/07/2001 13:09:55
 
 
À
31/07/2001 11:44:25
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00537719
Message ID:
00537849
Vues:
13
>even though it is indeed possible in VB, why would you _even_ want to do
>it in VB, VFP, or any other language. to save typing a few characters ?
>or am i missing some benefit that you see ?
>
>it's bad enough to use the default property in VB, but imagine how unclear
>code would be if you could redefine which property was the default property.
>

I have custom classes used for some of my data and I would have find this useful. To illustrate:
define class LogDO as Custom
   add object iLogID as CustomDataObject with Value = 0, ControlClass ='Textbox'
   add object iLogDesc as CustomDataObject
   *-- methods to assign data from a table to the objects...
enddefine

define class CustomDataObject as Custom
   Value   = NULL
   Caption = ''
   ControlClass = ''
enddefine
Now I have a custom data object that I can pass anywhere. And wouldn't it be wonderful if I can just say: oLogDO.iLogID instead of oLogDO.iLogID.Value ?

>certainly, a feature that i hope to never see !!

Different strokes for different folks.
ramil
~~ learning to stand still
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform