Solved

Default path- default disk drive - error file

Posted on 2011-09-27
8
436 Views
Last Modified: 2012-06-27
Normally I use my default path and error log file location hard coded in my main program.
If the environment is always stand alone we do not have any issues with this approach.
When we simultaneously have the same application deployed for stand alone and multi-user environments we need to change the code to redirect the default path and error file location (this is a DBF free table that I leave) from the C:\ drive to a shared network Drive named as W:\ for instance.
Can this locations and default disk os default path for Visual Fox be configured out of the code, I would say in the config file config.fwp?
0
Comment
Question by:luciliacoelho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 36708539
? JUSTDRIVE(SYS(2019,1))
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 36708541
What I mean is follow where the config file is if that might solve your problem. If it's on F then you assign F.
0
 
LVL 42

Expert Comment

by:pcelba
ID: 36708633
If am using CONFIG.DBF which is placed in the same folder as the app.EXE and may contain data pathes and other info required at program start. If the CONFIG.DBF is empty or missing then I suppose data are in the DATA subfolder of the app folder retrieved by SYS(16) function call.

No hardcoded disk drive and/or path exists in the code. Thus, I may move the application together with data almost anywhere without any change in its code.

It is better to leave at operating system decision where to place temp files since Vista. I am using SYS(2023) to determine where to save text error logs and other temporary files. The error log is also replicated in DBF which is a standard part of the application data.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:luciliacoelho
ID: 36708693
Cyril Captain
I've tried "? JUSTDRIVE(SYS(2019,1))" and within a messagebox but nothing returned on my screen.
Something wrong on my side?
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 36709032
It means that you don't have a config.fpw set up for the application.

I also do not hard code anything. I read the temp folders from the system and it behaves differently for 98/XP/Vista and 7.

The error and log files are in the main directory and there is the id of the user and email is sent upon confirmation of user. The error log can be dumped out on request.

You can also use SYS(16) to check where the program is executed from.
0
 
LVL 42

Expert Comment

by:pcelba
ID: 36709064
It just means your app or FoxPro does not use external CONFIG.FPW file.
0
 

Author Comment

by:luciliacoelho
ID: 36939885
Pcelba,
I try to includ in config.fpw file the path i want to my application, but i don´t know i can activate this file.
0
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 500 total points
ID: 36940432
You create or edit it via notepad or FoxPro.
It needs to be in the same folder as the exe. Once you load the exe it loads with it.

In the development version, there might be another config.fpw which might or might contain the same settings. The other one is in the main folder of FoxPro and not your project.

You can force FoxPro to load a specific config.fpw by calling it with the -c parameter.

How to: Create a Configuration File
http://msdn.microsoft.com/en-us/library/377x0zxd(v=vs.80).aspx

Setting Configuration Options at Startup
http://msdn.microsoft.com/en-us/library/aa977194(v=vs.71).aspx
0

Featured Post

Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question