Addo Well-Known Member Licensed User Longtime User Sep 12, 2020 #1 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
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 Sep 12, 2020 #2 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 ?) PassionDEV said: matter of fact i try to understand when i should use the callsubdelayed in general Click to expand... 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: Sep 12, 2020 Upvote 0
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 ?) PassionDEV said: matter of fact i try to understand when i should use the callsubdelayed in general Click to expand... 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.