iOS Question Null value for Me object

Pooya1

Active Member
Licensed User
Hello
I have a class that contain functions
Each function have argument (module and event)
And return result according to function usage
Example:
B4X:
Sub Number2Word(Module As Object,Event as String,Number As Int)
    If Number = 1 Then
        CallSubDelay2(Module,Event,"One")
    Else If Number = 2 Then
        CallSubDelay2(Module,Event,"Two")
    End if
End Sub

And call this function with below code
B4X:
Sub Page1_Resize(Width As Int,Height As int)
Dim fu As Convert
fu.Initialize
fu.Number2Word(Me,"Result_Convert",1)
End Sub

Sub Result_Convert(Res As String)
log(res)
End Sub

In mention code,when i call Number2Word,it does not raise Result_Convert
I try to check why didn't raised and i understood Module argument is null
 

Pooya1

Active Member
Licensed User
Om i have question about class and declare it
Is it bad if i declare variable of any class inline? (not declare in global)
Is it affecting on app?
 
Upvote 0

Pooya1

Active Member
Licensed User
No. It is fine. You can create local class instances as long as you don't need the class instance to be kept alive.
It was just a guess as there isn't enough information here to say anything.
Yes your guess it right,for kept alive class,we can declare it in global and for keep local,declare in function or relate scope
Thanks
 
Upvote 0
Top