dialog box to select a directory.

1)Below is code that will pop up a Dialog file selection Box
currently it is coded to select only files.
I would like to know how to select Directories or a Path ( not an individual file )

2)also line 3 is getting an exception when the “CANCEL” button is pressed.
exception: “passing non-adsolute shell paths is not currently supported”

Please Advise.

[code] Dim dlg As OpenDialog
Dim f As FolderItem
Dim DatType As New FileType

'DatType.Name = “text/dat”
'DatType.MacType = “TXT”
'DatType.MacCreator = “prvw”
DatType.Extensions = “dat;txt;inc”

dlg=New OpenDialog

#If Not (TargetLinux) then
dlg.InitialDirectory=SpecialFolder.Applications
#Else //open Home directory on linux
dlg.InitialDirectory=SpecialFolder.Home
#endif
dlg.Title=“Select a MIF directory”
dlg.Filter=DatType.Extensions //Defined as file type in FileTypes1.

f=dlg.ShowModal()
If f <> Nil then
Return Str(dlg.Result.NativePath)
Else
//User Cancelled
End if
[/code]

You would use SelectFolderDialog
instead. See http://documentation.xojo.com/index.php/SelectFolderDialog

wayne,

great !!

Thank you