I'm in the process of converting some apps from B4A to B4i
I stumbled multiple times in the different SubExist implementation: in B4A it has just 2 arguments, while in B4i it also requires and additional argument as the number of called sub args
So the following B4A code
will become
this is clearly non elegant and it looks like a candidate for "code smell"
is there a better way to handle this?
can i skip SubExists at all and just all the function, even if it does not exist, with no side effects?
I stumbled multiple times in the different SubExist implementation: in B4A it has just 2 arguments, while in B4i it also requires and additional argument as the number of called sub args
So the following B4A code
B4X:
If (SubExists(callback, "RefreshFPS")) Then
CallSub2(callback, "RefreshFPS", 0)
End If
B4X:
#if B4A
If (SubExists(callback, "RefreshFPS")) Then
#else if B4i
If (SubExists(callback, "RefreshFPS", 1)) Then
#end if
CallSub2(callback, "RefreshFPS", 0)
End If
is there a better way to handle this?
can i skip SubExists at all and just all the function, even if it does not exist, with no side effects?