|
Navigation: The Buzz > Operating System > FileDlg Default Directory > More on FileDlg from Steve Blank |
![]() ![]()
|
Mon Jun 30, 2003 Re: [magicu-l] FILEDLG() from a predefined directory
I just tested in Magic v7.11h and that syntax works for me.
Make sure that the translation for %DEFAULT_DIR% includes a
trailing backslash, as in 'C:\SomeDir\'.
Steve Blank
Tip: If you want to include more than one type in the Open
File dialog's 'Files of type' combo box, and filter accordingly,
use the following syntax:
FILEDLG ('My Files (*.tec)','%DEFAULT_DIR%*.tec'&CHR (0)&'All Files (*.*)'&CHR
(0)&'*.*')
This example allows the user to select 'All Files (*.*)' in the
combo box and, when they do, all files will be displayed.
-----------
Sorry, I lied.
I thought I'd tested FILEDLG() with a logical name but, in fact, I had
modified the wrong expression in my test program. This made me nuts for a
while until I realized what I had done.
Anyway, the logical name is not being translated in both Magic v7.11h and
in Magic v8.3 SP12. You can work around this problem however by replacing
the logical name %DEFAULT_DIR% with INIGET('[MAGIC_LOGICAL_NAMES]DEFAULT_DIR')
In Magic v9.3 SP5, the logical name IS translated, however, I am no longer
able to "trick" the function into multiple type options: the CHR(0) deal no
longer works -- fix one thing and break another...
In Magic v9.4, the logical name is translated AND the CHR(0) trick is back
working again, so it's looks like we're finally there. Now, if MSE would
just add a comparable BrowseForFolder function...***
Steve Blank
*** Editor's Note: they did, in V10. It's called DirDlg().
Page url: http://www.magic-iug.com/MIUGWeb3/index.html?hm_more_on_filedlg_from_steve_bla.htm