FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   Forcibly Exit loop()?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Forcibly Exit loop()?  (Read 255 times)
battey

WWW
Forcibly Exit loop()?
« on: Oct 16th, 2003, 12:07am »

Is there a way to forcibly exit loop?
 
i.e.
 
Draw() allows all processing to complete before drawing.
Loop() allows something to go on forever.
 
But if we want to animate something or build a drawing gradually using the framerate control of loop, but then stop the program now that it has completed its task...?
 
Of course, I can put a test inside loop that makes it stop animating once a certain condition is reached. But loop() is still running until Processing is stopped. Not a big problem, I guess.
 
benelek

35160983516098 WWW Email
Re: Forcibly Exit loop()?
« Reply #1 on: Oct 16th, 2003, 9:57am »

if you put everything in an if() statement inside the loop(), and have none of it running when it doesn't need to be (as you suggested), then very little processor useage will be eaten, if that's what you're worried about. if you want to be even more conservational, you can lower the framerate to close to zero when you're not doing anything.
 
or you could custom thread your sketch and just not have the thread re-run itself when you're finished
 
Pages: 1 

« Previous topic | Next topic »