Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access Method
Message
 
 
À
19/12/2019 09:09:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
01672305
Message ID:
01672310
Vues:
69
>>>>Hi,
>>>>
>>>>I looked at the VFP 9 help but the explanation of Access method is not easily understood. Could someone explain the purpose, the use, and advantages of using the Access Method (e.g. something_Access).
>>>>
>>>>TIA
>>>
>>>Tamar explains it well in this article: http://www.tomorrowssolutionsllc.com/Articles/Put%20Access%20methods%20to%20work.pdf
>>>And this is one of Doug's articles: http://doughennig.com/Papers/Pub/AccessAssign.pdf
>>
>>Thank you, Tore.
>
>You're welcome.
>
>Just to give you one sample. I use business classes for all my tables. For each field I have access methods, which all are something like this:
>
>*Myfield_access
>Return Evaluate(Myfield)
>
>So when I want to read this field value, I simply call MyClass.MyField.
>
>Likewise, I have an "opposite" method Myfield_assign which I use to change the field value.

Your example is much easier to read than many pages of an article. Thank you.
I have to follow with a very newbie question.
How is your Myfield_access different from assigning the value of the field to a property and getting the value from a property directly?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform