Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically accessing the program/project directory... 1

Status
Not open for further replies.

kindred

Programmer
Feb 28, 2001
50
US
Is there a way to access my program's home directory dynamically in vfp? I've tried using the HOME() cmd, but unfortunately this only works once your application is compiled. I'd like to be able to reference to the home dir even within the environment. Is there another of doing this?

Thanks,

Stephen Hardie

 
I create a system table to hold the application default locations and info
Drive c,2
SysDir c,50
SysDbf c,50
SysRpt c,50
SysFrm c,50
SptDbf c,50
WordFiles c,50
XLSfiles c,50
Faximgs c,250
... etc
I then scatter the table fileds into public memvers available to all other programs in the application.
David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Thanks for the idea. This was my original intentions to try, but I still come back to a dilema when even doing this...

The first moment my application launches the main startup file to inilialize everything before the form is opened it still needs to look somewhere for that system table you described above. It still needs an initial path.

It would be great if i can do something as simple as

MySystemTable = 'systable.dbf'

and it would just know that this is in the same directory as my .exe file.

Or am I not understanding what you mean by a System table?


Thanks again,

Stephen Hardie
 
Hi Stephen,

To determine the directory of your executable, use:

lcEXEPath=JustPath(Application.Servername)

Other suggestions include:

lcEXEPath=JustPath(SYS(16,1)) && returns the path to the 1st program in the call stack Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Thanks Jon,

I've been trying to figure this question out for a long time, I wish i knew it was so simple!

Thanks again!
Stephen Hardie

P.S. This is the best VFP forum/resource ive seen yet, its incredible!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top