[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Breaking from infinite loop?
- From: Ando Sonenblick <ando@...>
- Date: Fri, 08 Aug 2003 07:30:00 -0700
:)
I mean something like this:
while true do
print("Help!")
end
The primary concern is data loss; the secondary concern is professionalism.
To wit:
A user could launch my app, work for hours creating and defining graphic
elements, etc and not yet having saved, open a the lua interactive window (a
window I added to our app ala lua.c) and enter the above script and run it.
If there is no way to force lua out of such an infinite loop, the user is
forced to rudely terminate my app, losing all their hard work (data loss),
and making my app look not terribly professional...
Ando
>> Is there a way in lua to break out of an infinite loop? I don't see
>> anything on the web that covers it...
>
> You mean something like this?
>
> while true do
> do_something
> if something_else then break end
> do_something_more
> end
>
> --lhf
-----------------
SpriTec Software
www.spritec.com