I'm trying to figure out to change the default directory for OpenFileRequester to point to the directory of the previously opened file (assuming there has been a previously opened file). This is a fairly common behavior and saves a great deal time when loading several files. I can't figure out how to capture the path of the file when I navigate to it via OpenFileRequester. I've tried GetCurrentDirectory() but obviously it is not influenced by OpenFileRequester. I have searched and searched but not found a solution.
Any insight would be greatly appreciated thanks.
Jeff
Setting default directory of OpenFileRequester
Have you looked at the output when you select a file?
From the manual:
Code: Select all
Debug OpenFileRequester("","","",0)
The returned 'FileName$' can be easily split into file, path and extension string with the following functions: GetFilePart(), GetPathPart() and GetExtensionPart().
we just had such a question in the german forum.
under windows the Open/SaveFR do automaticly open in the last used (not canceled) directory. they use both the same. but of course you must specify a filename without a path as parameter 'defaultfile$', otherwise that path is used.
or you can do it like that
under windows the Open/SaveFR do automaticly open in the last used (not canceled) directory. they use both the same. but of course you must specify a filename without a path as parameter 'defaultfile$', otherwise that path is used.
or you can do it like that
Code: Select all
def_file.s = "C:\lalalalalalala"
Repeat
file.s = OpenFileRequester("title", def_file, "*.*|*.*",0)
If file
def_file = file ; or 'GetPathPart(file)' if you wish
EndIf
Delay(500)
Until 0