Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dealing with paths...
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00485806
Message ID:
00485828
Views:
7
>Hi friends! Is there a preferred way to deal with paths?
>
>Because you cannot determine beforehand where a user will install your app... is there a command that susses out the path so that it can be included with a set path to command in the start up program for example?


I use an INI file approach. I store the paths to the data in an INI file that is found in the directory where the exe is run. When the exe is run it reads the INI file and sets up the Paths that way through an environment manager object I created and a data manager object I created.

The main command I use is:

pcIniFile = JUSTPATH(SYS(2019)) + '\APPLIC.INI'

Since I use a config.fpw they Sys(2019) command will give me the path of where the exe is being run. I then read the ini file and ensure that the data is where they indicate. As they user can move the data files either manually (which developers usually do) or via the program. Either way the ini file is changed that details where the files are kept. Once the ini data is read then the environment is set up as to where the data is, the images are, etc...

HTH
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Reply
Map
View

Click here to load this message in the networking platform