it'is my procedure to tranform an absolute path in relative path. (i hope you understand what i say....Excuse me for my poooor English)
Code: Select all
Procedure.s RelativePath(FromPath.s,Path.s)
Protected l.w,c.w,NewPath.s
Newpath.s=""
c=0
For l=Len(FromPath) To 1 Step -1 ; We stat at the end of the string
If Mid(FromPath,l,1)="\" ; I count all new folder
c+1
If FindString(Path,Mid(FromPath,1,l),1) ; If we have the same path we break the loop
Break
EndIf
EndIf
Next l
For z=1 To c-1
Newpath+"..\"
Next
Newpath+Right(Path,Len(Path)-l)
ProcedureReturn NewPath
EndProcedure
File$=OpenFileRequester("Choose a File", FichierParDefaut$, Filtre$, Filtre)
While File$
Debug "Absolute Path:"+File$
Debug "Relative Path:"+RelativePath(GetCurrentDirectory(),File$)
File$ = NextSelectedFileName()
Wend