CallSub (Component As Object, Sub As String) As ObjectCalls the given sub. CallSub can be used to call a sub which belongs to a different module.
However the sub will only be called if the other module is not paused. In that case an empty string will be returned.
You can use IsPaused to test whether a module is paused.
This means that one activity cannot call a sub of a different activity. As the other activity will be paused for sure.
CallSub allows an activity to call a service sub or a service to call an activity sub.
Note that it is not possible to call subs of code modules.
CallSub can also be used to call subs in the current module. Pass Me as the component in that case.
B4A Class [B4X] CallSubPlus - CallSub with explicit delay - Erel    Nov 30, 2015   (26 reactions)
In many cases you need to run a task in a few seconds. The solution for such cases is to create a timer and then execute the task in the timer's Tick event. This is good for a single task. However if you need to run multiple tasks then it becomes difficult to maintain. This small class makes it much simpler. You just need to call CallSubPlus with the target sub and the delay. Internally it uses a (one shot) timer together with CallSubDelayed or CallSub. There are four methods: CallSubPlus...
B4A Code Snippet [XUI][Custom Views] Create Event Name for CallSub - LWGShane    Dec 22, 2022   (3 reactions)
Just a simple method that makes creating event names for CallSub easier. Useful for Custom Views.
Private Sub CreateEventName (SubName As String) As String
B4A Question [B4X] Resumable Sub, CustomClass Eventi and CallSub - Star-Dust    Mar 3, 2021
If SubExist(mCallBack,MEvent & "_Event") then
Wait for (CallSub...
Wish Unlimited number of arguments when using CallSub/CallSubDelayed - LucaMs    Jul 1, 2019
) I don't know if creating a CallSubDelayed4 (and CallSub4) that allows you to send...
B4i Question Callsub using string-based module name - Jack Cole    Sep 29, 2019
Using b4a, I can call a sub in a different module based on the string name of the module (say CallSub("SomeActivity", "SomeSub"). This is deeply integrated into many of my Android apps. I'm trying to port apps to b4i and discovered that CallSub will not allow the module name to be a string (it is expecting an Object). Is there a way to programmatically call a sub in another module based on the string-based name of the module in b4i?...
B4i Code Snippet CallSub with ANY number of parameters - narek adonts    Mar 9, 2019   (1 reaction)
Sub CallSubX (Component As Object,SubName As String,Params() As Object) Dim no As NativeObject=Component Dim name As String=SubName Dim ll As List ll.Initialize2(Params) For i =0 To Params.Length-1 name=name & ":" Next no.GetField("bi").RunMethod("raiseUIEvent:event:params:",Array(Null,name,ll)) End Sub Example usage Cal...
Other New feature: CallSub AutoComplete - Erel    May 24, 2018   (20 reactions)
B4A Question Callsub from a Service - Declan    Jun 29, 2022
I have a FirebaseMessaging Service that receives data.
I then parse the data
I must now call a Sub i...
B4A Question CallSub2 Sub not found - RB Smissaert    Mar 6, 2022
Dim oItem As Object = fMap.fShapes.Get(oKey)
'If CallSub2(oItem,"PointInShape", p) Then
B4J Question java.lang.reflect.InvocationTargetException if to make CallSub2 - peacemaker    Feb 2, 2022
, "meyadisk_RequestUploadPath") Then
CallSub2(Me, "meyadisk_RequestUploadPath", root... this CallSub2 line:
Error occurred on line: 245 (yadisk)
Page: 1   2   3   4   5   6   7