Skip to main content

Using displayIt instead of dialog

I'am trying to understand how to work with the function displayIt and the select case Action% and select case ControlId$. But i can't get it working on a simple script, what do i wrong? :
-----------------------------------------------------------------
Begin Dialog MainMenu 50,50,150,150,"NewDialog", .NewDialog
  CancelButton 93,109,40,15, "Cancel", .CancelButton1
  OKButton 9,110,40,14, "OK", .OKButton1
  PushButton 66,20,40,14, "Get File", .PushButton1
End Dialog
Option Explicit
 
Dim Exit_Script As Boolean
 
Sub Main
 
Call MainMenu1()
 
End Sub
 
Function MainMenu1()
 
Dim dlg As MainMenu
Dim button As Integer
button = Dialog(dlg)
 
End Function
 
Function displayIt(ControlID$, Action%, SuppValue%)
Dim Exit_Function_DisplayIt As Boolean
 
Select Case Action%
 
Case 1
 
Case 2
 
Select Case ControlId$
 
Case "CancelButton1"
MsgBox "Cancel"
 
Case "OKButton1"
MsgBox "Ok"
 
Case"PushButton1"
MsgBox "Select File"
 
End Select
 
End Select
 
If Exit_Function_DisplayIt Then
displayIt = 0
Else 
displayIt = 1
End If
 
End Function