Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing Private Data Sessions Through Objects?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Accessing Private Data Sessions Through Objects?
Divers
Thread ID:
00106742
Message ID:
00106742
Vues:
62
I'm wondering if anyone else uses object referencing to access private data sessions? For example, I have a searchable textbox class. The user types a name in and a search form is called showing the closest matches to the name typed in. Once the user selects a name from the list the id for that name is returned and an id field is replaced with the new id.

Currently, I do this by returning the id field back to the textbox class which then does a replace. There are several problems with this including the fact that since you can't really return a value from a form you have to code around that. Also, if you needed to return extra information or change the way information is returned you would have to parse a string together and then un-parse the string from the textbox. This does not make for very pretty code.

But, what if I passed the search form the textbox object as a parameter? Then, if I had a method called SetID() in the textbox class that replaces a field value with a passed value I would be able to call this method from my search form. So, even though the field I am replacing is in another private data session, I can access it through my object reference.

This seems to take care of all the previous problems. No more kludging around a return value, no more parsing a string together if you need to return different several bits of information. You would only need to add methods to the textbox class to take care of these things for you. In addition, this is a more object-oriented approach. All your code is encapsulated in the textbox class.

Michael G. Emmons
memmons@nc.rr.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform