elle extrait le nom du répertoire sans les [anti]slashs
Code : Tout sélectionner
Structure Characters
c.c[0]
EndStructure
Procedure.s GetDirectoryPart(FileName.s)
Protected Directory.s, i.l
Protected *Directory.Characters
Directory = GetPathPart(FileName)
If Directory
i = Len(Directory) - 2
*Directory = @Directory
While i >= 0 And *Directory\c[i] <> '/' And *Directory\c[i] <> '\'
i - 1
Wend
i + 2
Directory = Mid(Directory, i, Len(Directory) - i)
EndIf
ProcedureReturn Directory
EndProcedure
Debug GetDirectoryPart(#PB_Compiler_Home)
Debug GetDirectoryPart("a/b\c/d\e/f\g/h\i/")
