PDA

View Full Version : How to remember last folder opened?


hammerstein
02-17-2005, 01:37 AM
In ams 4 I know how to make file/folder browse remember last folder opened (i.e. after opening html file or mp3 file etc.), but in ams 5 I haven't figured it out yet. Any help would be appreciated.

Also, how to open more than a single mp3 file at a time (i.e. have them play one after the other). Thanx.

Derek
02-17-2005, 06:14 AM
You can use the variable to open the last folder:

LastFolder = Dialog.FolderBrowse("Please select a folder:", "AutoPlay\\Docs");
and next time, use:
Dialog.FolderBrowse("Please select a folder:", LastFolder);

As for multiple files, set MultipleSelect to true in Dialog.FileBrowse

TJ_Tigger
02-17-2005, 11:31 AM
I have done this in the past


if not LastFolder then
LastFolder = "AutoPlay\\Docs"
end
LastFolder = Dialog.FolderBrowse("Please select a folder:", LastFolder);


Tigg

Stefan_M
02-17-2005, 01:38 PM
If you wan't to remember a little bit longer, you can do something like this:

Project / Actions: 'On Startup'

--try reading last Folder from Registry
LastFolder = Application.LoadValue("MyProject", "LastFolder");
if LastFolder=="" then
--if doesn't exist use predefined folder
LastFolder = "AutoPlay\\Docs";
end;



Code placed in Button 'On Click'

--show browse dialog
NewFolder = Dialog.FolderBrowse("Please select a folder:", LastFolder);
if NewFolder~="CANCEL" then
LastFolder=NewFolder;
--write new folder to the registry
Application.SaveValue("MyProject", "LastFolder", LastFolder);
end;



Stefan_M

hammerstein
02-17-2005, 10:57 PM
Thanx for the help guys, appreciate it much. :)