Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The ACTUAL (programming) power of CLASSES
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00025282
Message ID:
00025313
Vues:
30
Barbara

Thanks, that is something to go on.

My initial disappointment remains, though, that 'true' objects seem to be limited to non-field things. I just had not anticipated this difficulty in all that I had read. Not that anything "lied" to me - more that I guess I read more into stuff than was really there.

I guess that's two things I now have on my list for FUTURE versions:
1) Capability to do VFP--to-VFP for table & record-set access/update;
2) Containers which can handle varying FIELD sources.

Cheers,
Jim N.
>>Continuing my quest to fully understand and EXPLOIT VFP's OOP capabilities. . .
>>
>>In the design stage of a small "system" which will have at least 5 forms where full addresses are to be shown/entered/modified in at least 6 different places.
>>
>>Thinking of the "consistency of look and feel" and the "objects can be reused to save much coding" I figured I could make a Container class with just the relevant fields displayed just-so and use that in the 6 different places noted above.
>>
>>However, I am stymied when it comes to the data in the fields - HOW, in a single such class, do I control where the data comes from and where it goes to??? As far as I can discern, only a form (or report) can have a DataEnvironment, and furthermore in at least one of the cases the source/destination fields would be different than in the other 5 instances.
>>
>>So far I have concluded (hopefully ERRONEOUSLY) that one cannot use OOP for such savings, and that I actually have to code each one individually.
>>
>>Any help gratefully appreciated,
>>Jim N.
>
>
>Jim, I see (at least) 2 scenarios: A, you are linking to the same table each time - multiple instances of the same addresses or B (more probable) you want to use the container for 6 different tables.
>
>In the case of A, just type the data into the controlsource property. As most of us have found with typos, the field will take ANYTHING at design time, whether it's a field in the dataenvironment or not. It only looks for a valid field at runtime.
>
>In B, you drop the container, then click on each field and assign the control source. Everything else, zipcode lookups, formatting of state abbreviations, etc. can be done at the class level.
>
>Third possibility: Put a property on the container for each of the textboxes. When you drop the container on the form, put the correct control source in each property. In INIT assign the property value to the controlsource property.
>
>Hope this gives you some ideas,
>Barbara
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform