B4A Question Select a class at runtime - agraham (first post)    Mar 09, 2022   (1 reaction) Yes but CallSub() is quite slow as, compared to a direct call, it has to look up the method to call in a hashtable and invoke it by reflection. It's not a huge overhead, particularly if the called Sub does significant processing, but if called repeatedly for a trivial Sub, say in a loop, it could im Wish CallSub - free number of parameters - Erel (first post)    Jan 23, 2019   (2 reactions) Use an array or a map. It is very simple. B4A Question DoEvents needed? - OliverA (first post)    Apr 16, 2020   (1 reaction) Ok, I may display my ignorance here, but CallSubDelayed creates an event, CallSub is a direct call and would therefore not give your app a chance to process other events. Plus if it were an Event generator, the sub would never get called (and here it is) since the loop has nothing in it to allow the B4J Tutorial [B4X] How Resumable Subs work - agraham (first post)    Jan 29, 2019   (5 reactions) It's nothing like the old Gosub! CallSub is probably the nearest equivalent to GoSub as with that you can do run-time determination of which Sub to call. This is a pause and resume capability that uses events raised on the message loop of the main thread to manage it. B4A Question GPS_LocationChanged not executing after starting up the GPS - rleiman (first post)    Feb 26, 2018   (1 reaction) Got it working. :)
I called
CallSub(Starter, "StartGPS")
from the scheduled service module which was in the Starter service module. From the Starter module I did all of the processing from GPS_LocationChanged by first stopping the GPS so that event won't be called repeatedly. This all happened whe B4A Question B4A.Callsub (Webviewextras) and javascript (SOLVED) - bernardR    Jun 26, 2023 Hello,
Despite much research I did not understand the difference between true and false in the javascript command
B4A.CallSub('subInB4a', false, data);
and
B4A.CallSub('subInB4a', true, data);
Thank you so much B4A Question Why does CallSub always cause app crashes? - klaus (first post)    Nov 09, 2024   (1 reaction) You should use:
CallSub (Me, "RE")
Or simply :
Re
Because the Sub is in the same module. B4A Class [B4X] CallSubPlus - CallSub with explicit delay - Erel    Nov 30, 2015   (26 reactions) Notes
- Make sure to include an underscore in the target subs names if you intend to compile with obfuscation.
- CallSubDelayed will start the target service or activity if needed (see this tutorial for more information: https://www.b4x.-callsubdelayed-to-interact-between-activities-and-services.18 B4A Library UltimateWebView Custom View - Ivica Golubovic (first post)    Jan 08, 2022   (4 reactions) B4A.CallSub("", true)
'Or
B4A.CallSub("", true, "message1")
'Or
B4A.CallSub("", true, "message1", "message2")
'Or
B4A.CallSub("", true, "message1", "message2", "message3")
'Or
B4A.CallSub("", true, "message1", "message2", "message3", "message4")
'Or
var value1 = B4A.CallSub("", false,.....)
B4A.Sho B4i Code Snippet CallSub with ANY number of parameters - Erel (first post)    Mar 10, 2019   (1 reaction) I don't recommend using this code. CallSub is treated in a special way by the compiler.
If you need to pass multiple parameters to a sub that called with CallSub then change its signature to:
Sub MySub (Params() As Object)
And call it with:
CallSub(Me, "MySub", Array(1, 2, 3, 4))
Or pass a cu Page: 1   2   3   4   5   6   7   Powered by ColBERT |