Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting Field-Mappings through code or configuration
Message
From
28/08/1997 01:20:49
Craig Mcclelland
Computer Fiscal Services
Sydney, Australia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00047247
Message ID:
00047269
Views:
29
>>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

Thanks for the reply Barbara.
Just to clarify the question a little ... we are actually trying to change the mappings/classes used for the drag-and-drop in the form designer before the form is created rather than after the event.
Naturally we can go into the tools\options sheets and change the mappings there manually but we were hoping to automate that to make it easier to swap between projects (we are very lazy programmers).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform