Android Question Call the same sub inside a sub ?

marcick

Well-Known Member
Licensed User
Longtime User
Is it doable or can create stack troubles ?
Something like this:

B4X:
Sub pippo() 

     bla bla ..
     bla bla...
     if .. then pippo

end sub
 

marcick

Well-Known Member
Licensed User
Longtime User
I was a bit confusing because:

If sub "sub1" call sub "sub2" then sub2 call "sub3", the end of sub3 return to sub2 and the end of sub2 return to sub1. So there is a stack mechanism.

Now, if "sub1" call itself, does it means that the stack is not updated, right ? And the end of sub1 does not return again to sub1 but to who called sub1 the first time, right ?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
So the behaviour is not like a GoTo.
I need to look carefully the program flow.
Thanks Klaus, bye
Marco
 
Upvote 0
Top