Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Field-Mappings through code or configuration
Message
 
À
27/08/1997 21:14:34
Craig Mcclelland
Computer Fiscal Services
Sydney, Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00047247
Message ID:
00047257
Vues:
20
>Some of our projects use different class libraries for the UI objects (unfortunately) so we want/need to change the field mappings (tools\options\field mappings) whenever switching between these projects to allow us to use drag-and-drop in the form designer.
>Is there any way of setting these mappings through code or saving multiple configurations just to save us manually changing these mappings manually each time.
>
>TIA
>Craig

Craig, since a form is just a dbf in disguise, you can edit the SCX files directly.

First MAKE A BACKUP!! (yes, I'm shouting, but it's easy to mess this up).

Second, open the form as a file: USE myform.scx Be sure you use the 'scx' extension.

Third, Browse. Look at the Class and Classloc columns.

Fourth, You'll need to change your class if these are different from project to project. These may remain the same if it's only different libraries you're using.

Fifth, change the ClassLoc fields to match the classes you want to use. If the library name is the same and only the directory changed, use the strtran() function to change a part of the entry.

Sixth, save and close, then re-open the form in the form designer. If there are no typos (that's what the backup is for), you've got a form linked to new libraries.

Try all this with a practice form that has a cursor and a couple of controls, so you can see how VFP organizes the SCX file.

I do this regularly when I want a form based on something other than my standard data-entry form - a memoedit or about screen, as well as for the reason you've mentioned.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform