Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get path to a directory
Message
From
13/12/2001 09:38:27
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00593473
Message ID:
00593823
Views:
23
Thanks Sergey, that was it!

Here is the code I'm using now:
pdir=""
lcpath=sys(2003)+"\"
lcCurrPath = Fullpath("")
lcSubdir = "progs"
lnCnt = 1
lcRelativePath = lcSubdir 
FOR lnLevel = Occurs("\", lcPath) TO 1 STEP  -1
	lcTestPath = Left(lcPath, Rat("\", lcPath, lnCnt))
	IF Directory(lcTestPath + lcSubDir)
		lcRelativePath = lcCurrPath + Replicate("..\", lnCnt-1) + lcSubdir 
		EXIT
	ENDIF
	lnCnt = lnCnt + 1
ENDFOR
pdir=Fullpath(lcRelativePath )
? pdir
Tracy
:0)
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform