I would like to see a "result" variable built into each routine that returns it automatically upon exiting (either completing or using the Return (i.e. exit)
For example:
B4X:
Sub DoSomething(param as boolean) as boolean
'result is automatically included as a local variable as boolean (or whatever type the routine returns)
try
'doing something
result=true
catch
result=false
end try
'upon completion our result is automatically returned, i.e. no need to use: return result
End Sub
??? If you run something that will crash or throw an error you should write your Try/Catch to handle the return value like this already. Why would I want extra overhead in all my methods for this when 9 times out of 10 what I'm executing in the method doesn't throw an error to create a possible issue? B4A actually handles much more of these for you already than when compared to JAVA.
When coding in other advanced IDE environments it will often even tell you it is possible to fail getting a Return due to an If statement/Error/etc and you should use a Try/Catch or Using or make sure that all paths of execution have a Return.
Thank you for your comment Roger. That was just a simple example. There is a multitude of opportunities to use a built in "Result" variable, basically anytime you have a function you will need to return a result. I come from Delphi (originally VB), and this is a built in feature, among many other desirable ones.
I would add that View Events have a built-in "Sender" variable to I can't see this being to difficult to do.