I avoid making recursive calls within a sub to avoid stack space issues. Those were a big deal in QB, but not so much in QB64. I would assign a variable, exit the sub, and the next statement would determine to either re-loop the subroutine or move on.
Pete
Code: (Select All)
Do
MySub x
If x = 1 Then Exit Do
Loop
Sub MySub (x)
a = Int(Rnd * 20)
If a = 5 Then x = 1
End Sub
Pete