This is a minor "bug" behavior I have noticed for a while but never investigated.
The File Requesters open in the last selected directory, even if you give a specific directory argument.
It's either PureBasic or Windows, caching the directory in some way? Can it be overridden?
Code: Select all
CompilerIf (#PB_Compiler_Debugger)
MessageRequester("Instructions",
"1. Compile this to an EXE (Desktop/test.exe or similar)" + #LF$ +
"2. Run it" + #LF$ +
"3. When the first requester opens, choose a file in a different folder" + #LF$ +
"4. The second requester opens in that folder (bug)" + #LF$ +
"5. Run the program again, and it opens in that changed folder (bug)" + #LF$ + #LF$ +
"Some sort of Windows caching issue ??" )
CompilerElse
;CurrentDir.s = GetCurrentDirectory()
;MessageRequester("Current Dir", CurrentDir)
ProgramDir.s = GetPathPart(ProgramFilename())
MessageRequester("Program Dir", ProgramDir)
OpenFileRequester("Title", ProgramDir, "All Files|*.*", 0)
OpenFileRequester("Title", ProgramDir, "All Files|*.*", 0)
CompilerEndIf