View Single Post
Old 03-31-2009, 09:50 AM
durf durf is offline
Join Date: Feb 2009
Posts: 61
stopping a function


I have def func1() and def func2() that do not run on timers of there own. I have a def maintask() that controls when each of the def() will start. The problem I am having is once func1() time has expired and func2() timer starts func1() keeps runnning.
def MainTask():
	#Run func1 for 10 seconds
	timer = vizact.ontimer2(0,0,func1)
	yield viztask.waitTime(10)
	#Run func2 for 10 seconds
	timer = vizact.ontimer2(0,0,func2)
	yield viztask.waitTime(10)

	#Quit script
	timer = vizact.ontimer2(0,0,func3)
	yield viztask.waitTime(viz.FOREVER)
viztask.schedule( MainTask() )
how do I stop func1() from running once func2() has started?

I can supply more code if need be. Just looking for an example
Reply With Quote