OpenfileRequester() accept StandardFile for directory

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

OpenfileRequester() accept StandardFile for directory

Post 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
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: OpenfileRequester() accept StandardFile for directory

Post 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:
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: OpenfileRequester() accept StandardFile for directory

Post by infratec »

I always use GetPathPart(ProgramFilename()) as parameter which returns a string containing the last \

Bernd
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: OpenfileRequester() accept StandardFile for directory

Post 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.
Post Reply