Thank you for your reply.
My code only worked when I used CallSubDelayed, no way with CallSub, and I think the result is a something strange.
This is my main activity:
Sub Activity_Create(FirstTime As Boolean)
Dim test As MyClass
test.Initialize(Me,"Message")
Log("Sum=" & test.sum(4,5))
End Sub
Sub Message
Log("Hello!")
End Sub
And this is my class code:
'Class module
Sub Class_Globals
Dim wMod As Object
Dim wSub As String
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(xMod As Object, xSub As String)
wMod = xMod
wSub = xSub
End Sub
Sub sum(a As Int, b As Int)
CallSub(wMod,wSub)
Log("1")
CallSub(wMod,wSub)
Log("2")
CallSubDelayed(wMod,wSub)
Log("3")
CallSubDelayed(wMod,wSub)
Log("4")
Return a+b
End Sub
This code resulted this when running:
Why CallSub didn´t returned anything?
Why the sequence of the results are different from the code?
I think the results should be:
Hello!
1
Hello!
2
Hello!
3
Hello!
4
Sum=9
I have a class where I create a list and need to select some itens. I want to leave the Activity process each click on this list.
What is the correct way to make this?
Thank you!