Recursion

2002-08-29 Thread Shari
Is there any way to turn recursion errors off? So that they don't halt a handler? I've built a stack that I want to run for as long as the user dictates, on its own. I have it set for the user to choose how many minutes, hours, or times for the handler to run. This isn't just one handler,

RE: Recursion

2002-08-29 Thread Yates, Glen
Is there any way to turn recursion errors off? So that they don't halt a handler? Shari -- --Shareware Games for the Mac-- http://www.gypsyware.com I don't know of any way to turn recursion errors off, however you may want to look at the recursionLimit property. This will allow you to

Re: More on recursion...

2002-08-29 Thread Michael Kann
--- Shari [EMAIL PROTECTED] wrote: Also, does anyone know how Metacard keeps track of recursion? Specifically? If a handler calls another which calls another which calls the first, is this considered a handler calling itself? --- Mike replies: Shari, I'd recommend that you rewrite your code

Re: More on recursion...

2002-08-29 Thread Phil Davis
One observation on avoiding recursion in MC - The way this 'task1' handler is written, it cannot finish executing until either 'task2' or 'task3' finishes executing, and control is returned to 'task1'; in other words, this kind of call blocks execution in the calling handler until the called

Re: More on recursion...

2002-08-29 Thread Shari
If a handler calls another which calls another which calls the first, is this considered a handler calling itself? --- Mike replies: Shari, I'd recommend that you rewrite your code to avoid recursion completely. In the long run you will save yourself much time and effort. As for your example,

RE: Recursion

2002-08-29 Thread Shari
I don't know of any way to turn recursion errors off, however you may want to look at the recursionLimit property. This will allow you to increase the recursion limit. Remember, however, that unending recursion will eventually kill your program no matter what the limit is. This is true of any

Re: More on recursion...

2002-08-29 Thread Shari
That's what I'm experimenting with right now. I changed one of the most important calls by adding send to it, and then an additional (very short) time lag, just as you said. So far the tests are good. Perhaps traditional programming books talk about recursion in detail, but I've never been

Background ops

2002-08-29 Thread Shari
While emailing you guys, I've got the program running in the background. Another test to see if things run smoothly. Looks good! I wasn't sure if putting Metacard in the background would allow everything to just keep right on flowing. I can see the animations and everything. Very pleased

Re: Recursion

2002-08-29 Thread Yennie
on theHandler     # do things     send theHandler to me in 1 millisecond end theHandler Would this trigger a Metacard recursion count? It shouldn't. What happens is this: 1. theHandler is triggered. 2. A message is queued to trigger theHandler again. 3. theHandler finishes executing. 4.

Re: Recursion

2002-08-29 Thread Shari
Thank you, Brian. Very nice explanation. I remember you from the Yennie externals collection for Hypercard. I still have them filed away in my Hypercard helpers folder :-) Now collecting dust as I've migrated to Metacard... It's nice to use a program that doesn't need a bunch of externals!

Re: More on recursion...

2002-08-29 Thread Phil Davis
- Original Message - From: Shari [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 29, 2002 12:33 PM Subject: Re: More on recursion... That's what I'm experimenting with right now. I changed one of the most important calls by adding send to it, and then an additional

Re: Recursion

2002-08-29 Thread Richard K. Herz
Is there any way to turn recursion errors off? So that they don't halt a handler? Shari The recursion limit problem can be avoided if you don't use functions and instead use handlers that call themselves and each other by using something like send myHandler to me in 10 ticks, returning

Re: More on recursion...

2002-08-29 Thread Sjoerd Op 't Land
Michael Kann wrote/ schreef: snip Recursion is one of those items like the ASCII chart that for some reason must be in all programming books. For what most of us are doing here it really is unnecessary and can cause problems. I disagree; what is a more elegant handler to calculate 7!,