Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stop the VFP OOP Madness!!!
Message
From
17/05/1998 05:22:13
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/05/1998 12:51:45
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00098883
Message ID:
00099966
Views:
37
>Dragan,
>
>You have written your own converter from FPD to VFP ? Wow! How did you do it?

I've made it easy for myself, because I'm not porting just any FPD code, I'm porting screens which conform to my own FPD framework, so I know what they must have, may have and surely do not have.

First I call OP< form >.prg which opens the tables, then loop through all the open tables and build a DataEnvironment object. I Createobject("maska"), which is my form class. Then I open the old .scx and scan it for fields and Say strings (I really never had Say variables or fields - they were always Get Disable), recalculate the coordinates and addobject() new control objects corresponding to the screen fields. After that I SaveAs("sameSCXname.scx").

Then I open both the new and old .scx and scan the Valid, When, and some other custom functions I've used before and move them into a text file after submitting them to a severe conversion (all m.var become thisform.var.value, some standard function calls become method calls, i.e. instead of "...noblank(m.field)" found in the old scx.valid, I put "return this.noblank(this.value)" into the valid method, because most of previous library functions are now class methods.

Along the way I search for local functions, i.e. procedures and functions which can be found in separate files or within When, Valid and other screen code, and add them as custom methods, replacing their calls with thisform.FNname() and such, maintaining the list to register them in the Reserved4 of the new .scx, and finally write it all into the .scx and open the converted form in Form Designer.

The thing I didn't like about this is that I've had to hack the newly created .scx just because there's no other way to add a custom method to a form programmatically. I've even opened the VFP converter source (not before that point, nor later) just to see how do they do it, and they also hack the .scx; I've expected it may be done via a builder or so, but no. Still, there's a way to do it in the form designer - there's a Form/Add new method menu item. It's just that it can't be invoked programmatically. As far as I remember, it was the search for a way to do this that led me to M$ VFP web page, then to VFUG, then to UT. Still haven't got the answer, but got UT - and the gain grossly outweighs the loss.

> Are you going to DevCon? If you are, I would like to meet you there since I am in the process of doing a similar conversion using Micro Endeavors Inc's methodology.

Maybe in 2005 or later. Not that I wouldn't like to, but take a look at my flag. Any explanation I could provide would involve politics, and this is not the place.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform