Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting value from a table opened in a different DS
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01453599
Message ID:
01453755
Vues:
57
This message has been marked as a message which has helped to the initial question of the thread.
>>Create a class "Datamapper" as custom, that has on property and two methods:
>>DataMapper.Aliasname
>>dataMapper.Getvalue()
>>datamapper.setvalue()
>>
>>The getValue() method is as follows:
>>
>>LPARAMETERS tcFieldname
>>RETURN EVALUATE(THIS.Aliasname + "." + tcFieldname)
>>
>>
>>and the setvalue() method is as follows:
>>
>>LPARAMETERS tcFieldname, tvValue
>>REPLACE (tcfieldname) WITH tvvalue IN (THIS.AliasName)
>>
>>
>>In your form, do the following code:
>>
>>MainapplicationObject.NEWOBJECT("Datamapper","Datamapper","LibraryWhereDatamapperexist")
>>MainapplicationObject.Datamapper.Aliasname = ??? *you should know the aliasname here.
>>MyValue = MainapplicationObject.Datamapper.GetValue("MyField")
>>
>>
>>What do you think?
>>
>
>Yes, I like the idea - looks like it will work well - how this design pattern is called?

Maybe a "Decorator"? I am not so sure about the names.
Christian Isberner
Software Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform