At 07:43 AM 6/16/2015, you wrote:
I just found that a form doesn't take the SET PROCEDURE TO line from
the program that calls it.
I have to re-issue the SET PROCEDURE command in form.init() in order
to get things done.
Is there some form properties that control this? Data Environment?
Assuming you don't have a typo that you're not seeing, then it really
sounds like your issue is a pathing problem.
If you only have one SET PROCEDURE call, then it has to be pathing.
It's not a scope problem; SET PROCEDURE is global. Therefore the
location of your procedure file must not be available when the form opens.
I always use the Project Manager to "include" all of my procedure
files, so they will be compiled into the .exe.
My framework code looks something like this:
** Main.prg
LOCAL classpath, progpath
IF _VFP.StartMode = 0 && Running in the IDE
** An earlier version. Actually the current version
** pulls these paths from a ProjectHook subclass.
classpath = "C:\STIC Foxpro Framework\Base Classes\"
progpath = "C:\STIC Foxpro Framework\Programs\"
ELSE
** Running an exe
classpath = ""
progpath = ""
ENDIF
SET CLASSLIB TO (classpath + "sticbase.vcx") ADDITIVE
** etc.
** The fxp file will also work here...
SET PROCEDURE TO (progpath + "handyprocs.prg") ADDITIVE
** etc.
*** Lots more stuff here...
***
***
** My framework form manager class.
oFormMgr.OpenForm("mainwindow")
***
***
** End main.prg
So when the program needs an external path (in the IDE), it has one.
When the program is relying on internally-compiled files, it doesn't
need a path.
I guarantee that if you follow this pattern in your code, it will
work when your form opens.
Ken Dibble
www.stic-cil.org
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/8C.00.04302.34612855@cdptpa-oedge02
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.