5 #define version $VER
: GetPath
.m
1.0 (02.03.04) BY JMC
- Desc
: Get parent of file
or drawer
.
7 EXPORT PROC
getpath(currentdir
:PTR TO LONG
)
8 DEF moins
=0,str
,pos
,test
10 test
:=String(StrLen(currentdir
))
11 StrCopy(test
,currentdir
,ALL)
12 IF test
[StrLen(test
)-1]<>":"
13 IF test
[StrLen(test
)-1]="/" THEN SetStr(currentdir
,StrLen(currentdir
)-1)
14 str
:=String(StrLen(currentdir
))
15 pos
:=String(StrLen(currentdir
))
18 MidStr(str
,currentdir
,0,StrLen(currentdir
)-moins
)
20 UNTIL StrCmp(RightStr(pos
,str
,1),'/',StrLen(str
))=TRUE OR StrCmp(RightStr(pos
,str
,1),':',StrLen(str
))=TRUE
21 StrCopy(currentdir
,str
,ALL)
23 StringF(currentdir
,'')