requestfile parse path

BlitzMax Forums/BlitzMax Beginners Area/requestfile parse path

hub(Posted 2010) [#1]
Hi !
how to parse the result returned by requestfile to have only the file path ?
Thanks !


Czar Flavius(Posted 2010) [#2]
I don't understand what you mean.

Print RequestFile("")


Picking a random file

C:\BlitzMax\bin\makedocs.exe


To get only the file name, try

Local path:String[] = RequestFile("").Split("\")

Local name:String = path[path.Length-1]

Print name



hub(Posted 2010) [#3]
i'm searching to get only the path without the file name.


Czar Flavius(Posted 2010) [#4]
Local path:String = RequestFile("")
Local result:String = path[..path.FindLast("\")]
Print result


Also consider RequestDir


hub(Posted 2010) [#5]
Many thanks !


Volker(Posted 2010) [#6]
Or
ExtractDir(requestfile())