Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ER: functions in methods
Message
From
18/10/2001 12:19:31
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00569195
Message ID:
00570326
Views:
29
>>It's more a matter of style and habits. Pretty much like a naming convention.
>
>Exactly. I think it would be a good optoin to have.
>
>>This example does not really answer this issue, it only shows that there are many different ways you can keep your code organized. Too bad the enhancement you want would require a major rewrite of VFP class engine.
>
>How do you know it would be major?

From messing a lot with .vcx and .scx files and getting to understand how it gets compiled. It parses the .methods memo and looks for the Procedure and EndProcedure lines, and stores their line numbers (or just byte offsets) somewhere in the compiled code. Just try to mess up with the memo without recompiling and see how it gets confused, i.e. out of sync. It also has to echo all the names of changed/added properties, array properties and methods in the Reserved3 memo.
Now allowing for snippets inside methods would require multiple levels here, and would require recursion etc. As it is now, the compiler is still single-pass (and that's what makes it so fast).

Then, again, there's really no need for that, as you can always have a class which will do it. In VFP7 there's a new thing which I have just discovered, third parameter to the WriteMethod method, lCreateMethod, which allows you to add methods on the fly while designing - even to members of a container, without any need to go for their classes to add methods there. This means you can just add a snippet object, which will be a placeholder to keep any such snippets you may need. It would still be neat and handy and would avoid the clutter you got when all the methods were defined (for they had to be) at the form or class level. Now you can add methods to any button on your form, without the need to mess up their class definition, or to subclass them. This is way cool - thanks for spurring up my curiosity, I was nicely surprised with what I found.

back to same old

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

Click here to load this message in the networking platform