B4J Question Call a CloseRequest Event

BPak

Active Member
Licensed User
Longtime User
I have an error with inconvertible type when trying to call a sub for CloseRequest.

MainForm_CloseRequest(Me)
'src\b4j\example\main.java:106: error: inconvertible types MainForm_CloseRequest

B4X:
Sub ExitMnu_Action
    MainForm_CloseRequest(Me)  ' inconvertible types
End Sub

Sub MainForm_CloseRequest (EventData As Event)
    DM.SQL1.Close
    MainForm.Close
End Sub
What would be the correct Param to use with MainForm_CloseRequest(?)
 

Daestrum

Expert
Licensed User
Longtime User
Could you not just make a new sub called CloseMain and call that. I don't think 'Me' is an Event, which could explain the message.
ie.
B4X:
Sub CloseMain
      DM.SQL1.Close
      MainForm.Close
End Sub
 
Upvote 0

BPak

Active Member
Licensed User
Longtime User
Yes. It could be called from both the event and the ExitMnu_Action.
Thank you.
 
Upvote 0
Top