dialog file box will not show up

I am trying to pop up a file dialog box after clicking on a button for an Action.
this code is not working

please advise.

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

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

dlg=New OpenDialog
#If Not (TargetLinux) then
dlg.InitialDirectory=SpecialFolder.Documents
#Else //open Home directory on linux
dlg.InitialDirectory=SpecialFolder.Home
#endif
dlg.Title=“Select a MIF file”
dlg.Filter=DatType.Extensions //Defined as file type in FileTypes1.
f=dlg.ShowModal()
If f <> Nil then
//proceed normally
Else
//User Cancelled
End if[/code]

do you have ‘break on exceptions’ turned on?
If you are getting anexception, it may be bouncing from here straight to unhandled exception…

no i did not set “break on exceptions”
i shall i do that ?

Should be:

Dim DatType As New FileType

And definitely leave “Break On Exceptions” selected. It will help you find bugs in your code by dropping you into the debugger when an exception occurs.

ok great that worked

thank you