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