# Filebox change directory

Author: roger.wallin@abilita.fi (rogerw)

Hi, I would like to let the user select a directory, starting from another directory ("c:\temp\") than the working directory. I tried filebox/dir "c:\temp\" if (\$status=1)    myCatalog = \$result endif But, it always starts from the working directory, ie. first showing the working directory in the filebox instead of ("c:\temp\") . How should filebox/dir work?  Regards RogerW.

1. Hi RogerW, This seems to work:

filebox/dir "*.*", "c:\temp\" It seems that the syntax of the filebox statement should look like this:

filebox{/save | /dir | /savenocheck} {Filter{, DefaultDirectory}}   Instead of:

filebox{/save | /dir | /savenocheck} {Filter}, {DefaultDirectory}   Hope this help. Regards, Daniel

Author: diseli (daniel.iseli@uniface.com)
2. Hi Roger, AFAIK using: filebox/dir "", "C:\Temp" enduser is positioned one level lower in the path defined; in your example C:\ If you need to start from C:\Temp you should create a (fake?) directory below C:\Temp like C:\Temp\myFakeDir and redefine your code to: filebox/dir "", "C:\Temp\myFakeDir" Gianni

Author: gianni (gianni.sandigliano@unifacesolutions.com)
3. gianni said Hi Roger, AFAIK using: filebox/dir "", "C:\Temp" enduser is positioned one level lower in the path defined; in your example C:\ If you need to start from C:\Temp you should create a (fake?) directory below C:\Temp like C:\Temp\myFakeDir and redefine your code to: filebox/dir "", "C:\Temp\myFakeDir" Gianni

Hi Gianni, You have to finish the directory with a backslash and then it's working as expected; e.g.

filebox/dir "", "C:\Temp\" And it seems that it's sufficient to specify an empty string for the Filter parameter. The important thing is that it's defined (see the revised statement syntax I've mentioned in my reply above). Hope this helps. Daniel

Author: diseli (daniel.iseli@uniface.com)
4. Thanks, it's working now. I made some similar tests, but apparently not the right one . Regards RogerW.

Author: rogerw (roger.wallin@abilita.fi)
5. diseli said
gianni said Hi Roger, AFAIK using: filebox/dir "", "C:\Temp" enduser is positioned one level lower in the path defined; in your example C:\ If you need to start from C:\Temp you should create a (fake?) directory below C:\Temp like C:\Temp\myFakeDir and redefine your code to: filebox/dir "", "C:\Temp\myFakeDir" Gianni
Hi Gianni, You have to finish the directory with a backslash and then it's working as expected; e.g.

filebox/dir "", "C:\Temp\" And it seems that it's sufficient to specify an empty string for the Filter parameter. The important thing is that it's defined (see the revised statement syntax I've mentioned in my reply above). Hope this helps. Daniel

Hi Daniel, ahhh...just the \ is enough! Thanks! Gianni

Author: gianni (gianni.sandigliano@unifacesolutions.com)