Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dissapearing memvar
Message
 
À
09/09/1998 08:33:34
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00134402
Message ID:
00134823
Vues:
10
>>In the init of the page frame I scatter memvar

>The variables that you create in the INIT of the pageframe are by default Private to that piece of code. Once the Init code finishes, the variables are automatically released.
>

Mark is correct here.

>So, either
>a) PUBLIC the variables - Bad idea.

I agree. Bad idea.

>b) Add properties to the form, scatter the memvars, then copy them to the new form properties. - This is the best MemVar type solution.

High maintenance overhead in the long run.

>c) You could add an array property to the form, scatter the memvars to an array, then ACOPY the scattered array to the Form property array. - A bit long winded and you will have meaningless array references appearing at design time in your form controls (but you get out of having to manually copy the variables).

Also has high maintenance overhead in the long run. Imagine what would happen if you added a new field in the middle somewhere.

My recommendation is to drop the concept of SCATTER MEMVAR entirely. It's not necessary anymore and is redundant to VFP's buffering capabilities. Turn on optimistic buffering, then when the user saves, do a TABLEUPDATE(), otherwise do a TABLEREVERT(). In this way, your controls will be bound directly to the data fields, making long term maintenance easy.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform