Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing current directory and relative path
Message
De
03/11/2010 15:56:33
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01488018
Message ID:
01488072
Vues:
59
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I'm using relative paths in the development. I have code that changes the current directory and then all my relative paths don't work anymore.
>
>Is there a method to fix the probem (still use the relative paths, but allow changing of the main directory)?

If you're setting your paths at startup, convert them to absolute at that point... like this:
	Do addpath With 'libs'
	Do addpath With 'frx'
	Do addpath With 'forms'
	Do addpath With 'tools'
	Do addpath With 'stuff'
...

Proc addpath
	Lparam cPath
	Try
		cPath=FullPath(Addbs(cPath))

		If Directory(cPath)
			If Atc(cPath+',', Set('path')+',')=0
				cPath=Set('path')+','+cPath
				Set Path To (cPath)
			Endif
		Endif
	Catch To oEx
		Assert .F. Message oEx.Message
	Endtry

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform