B4J Question B4j using callsubdelayed

PassionDEV

Well-Known Member
Licensed User
i have i have 3 Standard class module in my none-UI b4j project

should i use callsubdelayed to call the subs between the modules ?

matter of fact i try to understand when i should use the callsubdelayed in general
 

LucaMs

Expert
Licensed User
Longtime User
If they really are CLASS modules, you have to istanziate them, which means create objects from those classes; then you can call all the object members (Public Subs) just like with any other objects, like a TextField (TextField1.Text =...).


Say you have a class module named "MyClass":
B4X:
Dim obj As MyClass
obj.Initialize

' No need to use CallSubDelayed to call AnyPublicRoutineWroteInsideYourClass from anywhere (but you can).
obj.AnyPublicRoutineWroteInsideYourClass(Parameters ?)


matter of fact i try to understand when i should use the callsubdelayed in general
Just when the routine must be executed after the next code.
B4X:
Sub AAA
    ' ...
    CallSubDelayed(Component, "SubName")
    ' other lines to be executed BEFORE "SubName" here
End Sub


With B4A you need to use CallSubDelayed to call service modules' routines.
 
Last edited:
Upvote 0
Top