Done?

done? instruction-list

Reports true if the process indicated is completed. The process must have been launched using launch or forever. The input must be an exact copy of the instruction list that started the process. Done? can be used as an input to waituntil in order to synchronize events.

Example:

Circle and square are procedures, and there are two turtles on the page.

to circle

repeat 36 [fd 10 rt 36]

end

to square

repeat 4 [fd 50 rt 90]

end

In the following procedure, t1 makes a circle at the same time t2 makes a square. It takes longer to draw a circle, but MicroWorlds will wait for both shapes to be finished before telling the turtles to go elsewhere on the page to draw more circles and squares.

to sq-circ

t1, launch [circle]

t2, launch [square]

waituntil [done? [circle]]

t1, rt random 360 fd random 50

t2, rt random 360 fd random 50

sq-circ

end