LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Abort recursion

If I have a procedure which I call recursively. Is there a way I can say
exit all the way out completely. I know I could put logic and pass
flags up through the parameters etc. but just wondered if I could do
this another way

e.g a simple example

Sub Main ()
Hello (1)
End Sub

Sub Hello (x as Integer)
MsgBox x

if x < 10 then
Hello(x+1)
else
<some more processing
end if
end sub

It's a bit hard to explain cos the above is simple and what I am trying
to do is more complicated, but when the recursion reaches the end, I'd
like all the levels of Hello to unravel with no more execution taking
place
--
Mike
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recursion Mike NG Excel Programming 4 June 2nd 05 11:07 PM
Worksheet_Change Recursion ARGHH! DBAL[_2_] Excel Programming 6 July 1st 04 11:55 PM
Recursion with user defined functions bigJim Excel Programming 1 December 15th 03 01:00 PM
Abort or continue Jason Gatsby Excel Programming 0 August 5th 03 02:16 AM
Abort or continue Ed Ferrero[_4_] Excel Programming 0 August 5th 03 02:01 AM


All times are GMT +1. The time now is 01:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"