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. Example: CallSub(Main, "RefreshData") 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 Question [B4X] Resumable Sub, CustomClass Eventi and CallSub - Star-Dust    Mar 3, 2021 Could an event called by a class be a sub Resumable? For example Sub Class_Event as ResumableSub Return True End Sub And could the class invoke the event and wait for completion? Something like this 'Call Event If SubExist(mCallBack,MEvent & "_Event") then Wait for (CallSub(mCallBack,MEvent & "_Event")) Complete (Success As Boolean) End If... 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.
Method:
Private Sub CreateEventName (SubName As String) As String
Return $"${mEventName}_${SubName}"$
End Sub
To use:
CallSub(mCallBack, CreateEventName("YourEvent"))
... Italian CallSub e CallSub2 - Fulvio75    May 23, 2023 Ciao a tutti, ho notato che se da un modulo di classe A chiamo una Sub in un modulo di codice B con CallSub(B,"NomeSub") quando compila mi da errore, se invece utilizzo CallSub per chiamare...?
CallSub(b,\
shell\src\xxx\software\gau\a_subs_0.java:513: error: cannot find symbol
a.__c... 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?... Italian Chiamata CallSub2 - Fulvio75    Nov 30, 2023 Ciao, ho un problema con il CallSub2 durante la compilazione che va in errore perchè?
ModuloA è un... la sub chiamata deve interpretare
CallSub2(ModuloA,"Get_" & Codice & "_... 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) 68252... 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... Page: 1   2   3   4   5   6   7   |