Solved

Default path- default disk drive - error file

Posted on 2011-09-27
8
429 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
  • 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 41

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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 41

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cannot locate the microsoft visual foxpro support library 6 455
Programming code with runtime form 4 635
convert/ import XLSB / vfp9 5 76
Foxpro 64bit decoding 8 171
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…
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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