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
#Else //open Home directory on linux
dlg.Title=“Select a MIF directory”
dlg.Filter=DatType.Extensions //Defined as file type in FileTypes1.

If f <> Nil then
Return Str(dlg.Result.NativePath)
//User Cancelled
End if

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


great !!

Thank you