It would be very very handy to have also CallSub4 because it is be essential for passing data of touch events (Action, X, Y).
B4X:
CallSub4 (Component As Object, Sub As String, Argument1 As Object, Argument2 As Object, Argument3 As Object) As String
CallSub4("Main","Activity_Touch",Action,X,Y)
It would be very very handy to have also CallSub4 because it is be essential for passing data of touch events (Action, X, Y).
B4X:
CallSub4 (Component As Object, Sub As String, Argument1 As Object, Argument2 As Object, Argument3 As Object) As String
CallSub4("Main","Activity_Touch",Action,X,Y)
'Class module ArgumentsContainer
Sub Class_Globals
Public argument1 As Object
Public argument2 As Object
Public argument3 As Object
Public argument4 As Object
Public argument5 As Object
End Sub
B4X:
Dim argc as ArgumentsContainer
argc.initialize
argc.argument1="one"
argc.argument2="two"
argc.argument3="three"
argc.argument4="four"
callsub2(Main,"function_name",argc)
note that any of the argments kan be an argumentscontainer as well....
the example of Penko is exactly what I mean.
B4X:
Sub function_name(argc as ArgumentsContainer)
dim x as string
x=argc.argument4
msgbox(x,"this is argument4)
end sub
'Class module ArgumentsContainer
Sub Class_Globals
Public argument1 As Object
Public argument2 As Object
Public argument3 As Object
Public argument4 As Object
Public argument5 As Object
End Sub
B4X:
Dim argc as ArgumentsContainer
argc.initialize
argc.argument1="one"
argc.argument2="two"
argc.argument3="three"
argc.argument4="four"
callsub2(Main,"function_name",argc)
note that any of the argments kan be an argumentscontainer as well....