[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Status Banner
> I tested my banner (which is at
> http://gmccomb.com/javascript/banner_start.html) and it did some 3,000
> iterations without a peep, so I know it's possible to construct these
> without corrupting the stack or running out of memory.
>
> -- Gordon
> >
> >Mine is also somewhat the same. I turn the msg string into a loop. I
> >agree. Passing arguments (poor Mr. Stack), and if this...then
> >that...else something else sounds like band aid code to me.
>
I agree. Mine uses endless recursion since there is no other choice.
BTW Netscape calls the use of setTimeout() in this manner recursion
although it does seem to act differently than just calling a function
within a function.
My only point was if there are alternatives to passing arguments that
yield the same results then why not use them. BTW I tested mine through
48,000 levels without an incident and I found out something
interesting in the process. After about 42,000 levels I started
hearing far more disk activity than normal. I have a feeling Netscape
caches this stuff to disk after a while. Not a bad idea, really.
However, there is no way to expect that all Netscape versions for all
platforms will act the same. While much of the code may be re-usable,
much is not. I wish Netscape would release some docs on the
internals. Not how it works but instead what it expects.
My new banner routine will be in use soon. It recurses to the level
of message_string.length, does a return, and then starts over again.
The recursive function that calls it will add just one additional level for
each iteration of the message string (16 byte integer?) That should
be safe on all platforms unless you send War and Peace to it.
John
--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/