Page 1 of 1

OpenfileRequester() accept StandardFile for directory

Posted: Mon Sep 18, 2017 9:43 am
by infratec
Hi,

current state (windows) if the standard file is only a directory, the directory is not always selected.
If the standard file is a not existing file in the directory, the directory is not always selected.

There is no 100% working way to set an absolute directory as startpoint for the OpenFileRequester().

Ok, in the help is written StandardFile, so I didn't post this in the bug section.
It looks like a feature request. :wink:

Bernd

Re: OpenfileRequester() accept StandardFile for directory

Posted: Mon Sep 18, 2017 10:08 am
by Marc56us
In the first case (directory only) I noticed that this only happens if I forget the final antislash.
(PB 5.61) (and I often forget it)

Code: Select all

OpenFileRequester("", "C:\Windows\", "", 0)
; OK, \ at end so open in C:\Windows

OpenFileRequester("", "C:\Windows", "", 0)
; Open in root and use Windows as filename
But that's probably the expected behavior. What else to do ?
:wink:

Re: OpenfileRequester() accept StandardFile for directory

Posted: Mon Sep 18, 2017 10:47 am
by infratec
I always use GetPathPart(ProgramFilename()) as parameter which returns a string containing the last \

Bernd

Re: OpenfileRequester() accept StandardFile for directory

Posted: Mon Sep 18, 2017 10:50 am
by Dude
Marc56us wrote:But that's probably the expected behavior.
Of course it is. In your second example, you're using a file named "Windows" as the default file to be selected. Nothing wrong with that.