More on recursion...

Michael Kann mikekann at yahoo.com
Thu Aug 29 12:20:00 EDT 2002


--- Shari <gypsyware at earthlink.net> 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 to
avoid recursion completely. In the long run you will
save yourself much time and effort. As for your
example, let's assume that btns A,B, and C hold
scripts that call each other in the manner that you
describe (I'm just using btns instead of handlers). A
better way is to have another btn D that controls the
three btns. In btn D put the script:

on mouseUp
  repeat 100 -- as many times as you need
  send mouseUp to btn "A"
  send mouseUp to btn "B"
  send mouseUp to btn "C"
  end repeat
end mouseUp

In your other posts you mentioned something like
"handlers calling each other." This should also be
avoided. 

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.

Don't take this post as being at all critical of your
programming. If you want any more help just email me
at mikekann at yahoo.com  

Good luck, Mike



__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com



More information about the metacard mailing list