5 EXPORT PROC
getpath(currentdir
:PTR TO LONG
)
6 DEF moins
=0,str
,pos
,test
8 test
:=String(StrLen(currentdir
))
9 StrCopy(test
,currentdir
,ALL)
10 IF test
[StrLen(test
)-1]<>":"
11 IF test
[StrLen(test
)-1]="/" THEN SetStr(currentdir
,StrLen(currentdir
)-1)
12 str
:=String(StrLen(currentdir
))
13 pos
:=String(StrLen(currentdir
))
16 MidStr(str
,currentdir
,0,StrLen(currentdir
)-moins
)
18 UNTIL StrCmp(RightStr(pos
,str
,1),'/',StrLen(str
))=TRUE OR StrCmp(RightStr(pos
,str
,1),':',StrLen(str
))=TRUE
19 StrCopy(currentdir
,str
,ALL)
21 StringF(currentdir
,'')