Code: Select all
Dir$ = GetHomeDirectory() + "Documents\" ; set default directory
DefaultFile$ = Dir$ + "MyFile.txt" ; set default file
Pattern$ = "Text (*.txt)|*.txt"
Repeat
File$ = SaveFileRequester("Save", DefaultFile$, Pattern$, 0)
If File$ <> "" And GetPathPart(File$) <> Dir$
MessageRequester("Error", "Please do not change directory.")
EndIf
Until File$ = "" Or GetPathPart(File$) = Dir$ ; exit if user cancels or directory unchanged
Can anyone shed some light on this odd behavior? or is it a bug? or am I doing something wrong? Could Windows be somehow associating the last accessed directory with that exe file and overriding the default?
The same behavior occurs with OpenFileRequester().
Test environment: Windows 10 Pro, x64, PB5.73