Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and SQL at the same time
Message
From
14/01/2019 18:32:46
 
 
To
14/01/2019 18:14:28
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01664796
Message ID:
01665407
Views:
71
>>>Just want to point out that my code for splitting a procedure file into individual PRGs is now in the Thor Repository. My article about it, including the reasons I don't like procedure files, is here: http://www.tomorrowssolutionsllc.com/Articles/Splitting%20a%20Procedure%20File.PDF
>>
>>Having a common utils.prg allows encapsulation, a single place to search for the function you need.
>
>No. Encapsulation is a runtime consideration. Storing stuff in a drawer is not encapsulation.

Encapsulation is considerate of both types (in a single file, in a compiled app).

VFP traverses each file it stores individually when searching for the function. It searches by name, then by the procedures within. It would not surprise me to learn that VFP actually compiles .PRG files written like this:
* myprog.prg
&& real program content here
As though they were written like this:
* myprog.prg

FUNCTION myprog
&& real program content here
And then to find that myprog.prg, it actually looks for myprog as a top-level procedure / function name performing its procedure / function search. Just a guess, but given that the need to search for functions / procedures exists, it is a natural use of that ability.

>>When trying to find your missing function use Tools -> Code References and search for "FUNCTION myFuncName" and you'll find it quickly ... if you truly don't know where it is.
>
>I always know where it is. It is in myfuncname.prg

Me too. It's in utils.prg. I even have a hot key to be used when you're on a function to load:
ON KEY LABEL F12 KEYBOARD "{Ctrl+LeftArrow}{Ctrl+Shift+RightArrow}{Ctrl+C}{Ctrl+F2}{Ctrl+F2}MODI COMM progs\utils.prg{Enter}{Ctrl+F}FUNCTION {Ctrl+V}{Enter}"
:-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform