Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Good reason to never use form methods
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00415216
Message ID:
00421249
Views:
16
>>....We just reduced the size of our EXE 60K by removing the methods from one complicated form and putting them in >PRG files....
>
>I thought about doing this as well a few months back, because I remember from Foxpro 2.6 that screens compiled a lot faster if most of the codes were in a prg file.
>
>I have one question for you. How did you handle things like "THISFORM...." reference from the prg file? Didn't you get and error message such as "Thisform can only be used within a method...."? or are you capturing the form object to a variable and reference that varible?

Andy,
When you call your prg from within the form use THISFORM as one of the parameters. In the prg I usally call it oForm.

ie.
(In Form) DO MYPROC WITH THISFORM
(In Prg) PARAMETERS oForm

Then use oForm anyplace you would use THISFORM in your prg. It works the same because it is pointing to the same thing.

Hope this helps.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Previous
Reply
Map
View

Click here to load this message in the networking platform