Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the best way to set the starting path?
Message
De
17/01/2005 06:55:12
 
 
À
14/01/2005 17:56:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
00977105
Message ID:
00977692
Vues:
28
>Hi, Peter
>
>I'm sorry to interfeer, but I want to ask you to explain this a little. I'm not sure it will work - the icon can have Working Directory set to something else. So, doubleclicking it will launch the exe in the directory set by the icon. In that case, CURDIR() will point God knows where.
>
>What about gcStartupDir = Sys(5) + JustPath(Sys(16))?
>
>Thank you.
>
>>
>>BTW, put this somewhere on top of your main program::
private gcStartupDir
>>gcStartupDir = sys(5) + curdir()
Grigore,
THANK YOU for correcting me! I've looked up how I handle this in my applications. Here's the code:
*	If the startup folder isn't equal to the EXE folder, we'll add the EXE folder 
*	to the searchpath. This implies that the startup folder will remain the default folder!
if atc( justpath( sys( 16, 0 ) ) + ';', set( 'path' ) + ';' ) = 0
	*
	if empty( set( 'path' ) )
		set path to justpath( sys( 16, 0 ) )
	else
		set path to set( 'path' ) + ';' + justpath( sys( 16, 0 ) )
	endif
endif
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform