B4J Library jCallSubPlus

I was so happy with the CallSubPlus function of B4R that I had to have it in B4J.

This lib allows you to add 1 or more CallSubs to be executed at a later time.


Sub Process_Globals
Private fx As JFX
Private MainForm As Form

Public CallSubPlus As jCallSubPlus
End Sub

Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UNIFIED")
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.

CallSubPlus.Initialize
CallSubPlus.Log = True
CallSubPlus.Add("Main","Test1", 10) 'No argument, call in 10 secs
CallSubPlus.Add1("Main","Test2", "A1", 12) '1 argument, call in 12 secs
CallSubPlus.Add2("Main","Test3", "A1", "A2", 14) '2 arguments, call in 14 secs

MainForm.Show
End Sub

Sub Test1()
Log("Test1")
End Sub

Sub Test2(Arg1 As String)
Log("Test2 - Arg1: " & Arg1)
End Sub

Sub Test3(Arg1 As String, Arg2 As String)
Log("Test3 - Arg1: " & Arg1 & " - Arg2: " & Arg2)
End Sub
 

Attachments

  • jCallSubPlus.zip
    3.9 KB · Views: 392
Last edited:
Top