Android Question Are there any limits in nested "wait for"?

vecino

Well-Known Member
Licensed User
Longtime User
Hello, my question is that, if there is any limit when using "wait for" nested between different "sub".
Thank you.

Fictitious example:
B4X:
sub aaa
  bbb( x )
  wait for bbb_completed
end sub

sub bbb( x as int )
  ccc( y)
  wait for ccc_completed

  callsubdelayed(me,"bbb_completed")
end sub

sub ccc( y as string )
  do something
  ddd( z )
  wait for ddd_completed

  callsubdelayed(me,"ccc_completed")
end sub

sub ddd( z as boolean )
  do something
 
  callsubdelayed(me,"ddd_completed")
end sub
 

vecino

Well-Known Member
Licensed User
Longtime User
Hello, thank you.
And for cases where a "Sub" returns at different points of another "Sub", what should be used?
Example:

B4X:
sub aaa
  wait for (bbb("hello") complete (result as object)
  continue doing something
end sub

sub bbb( zzz as string )
  some code
  return null
  '
  other code
  return null
  '
  some other code
  return null
  '
  And finally
  return null
end sub
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Sorry, I was just trying to confirm what I understood by watching the video tutorial.
It's just that my knowledge of English is not enough to understand the narration you do, I could only follow the video.
Thank you.
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Hi vecino:

Maybe if you explain what you're trying to do with your real code, then it will be easier to help you.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hi, it works fine with "ResumableSub" and "Return Null" when it is not necessary to return anything.
Thank you.
 
Upvote 0
Top