Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting paths for new application
Message
De
01/08/2003 05:22:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00815759
Message ID:
00815776
Vues:
10
>I have a new application stored in C:\Foxpro Projects\Projects\Discount:
>
>Within this folder are my project sub folders i.e.
>
>Classes
>Forms
>Programs
>Pictures
>
>etc etc
>
>When I click a button on my main form to bring up another form I have to type in:
>
>do form 'c:\foxpro projects\projects\discount\forms\employees'
>
>I know this is wrong as I should not hard code paths. Can somebody put me in the right direction as to how to set up my paths correctly.
>
>Thanks in Advance

Neil,
In startup prg (or form,menu whatever is the main) :

set default to 'c:\foxpro projects\projects\discount'
set path to 'classes;forms;programs;pictures'

However you only need this in development environment and these could be set from menu tools\options\file locations.

For executable you only need a set path to data (and maybe reports if your reports are not icluded in project) folder.

What I do is :
From menu tools\options\file locations I set 'Search path' to (this is my folder skeleton for all projects):

classes;data;reports;include;forms;bitmaps;libs;progs;

I also have 'Default directory' set to my project folder I'm currently working on (this only helps me out to be in that directory when I startup VFP). If during working I need to switch to another project I simply write :

set default to 'c:\mypath\other project folder' [enter]

in command window and continue to work on that new project :) set('path') is reserved and works in this new folder :)

In my main.prg there is a routine that checks if user's data folder path is set. If yes then sets path to that folder, if not then asks user the path and records the path for next startup (and sets the path for current session).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform