loop(prog_tools) Programming Tools loop(prog_tools)
NAME
loop - a loop for executing actions
DESCRIPTION
Loop is a general loop that executes tick_actions for each
iteration through the loop. When it starts, a loop executes its start_actions. Upon completion it executes it
end_actions. A loop's index is kept in its time
instance
variable. Each iteration, time
is incremented by 1 over
its resolution.
When time
exceeds duration
, the loop
ends.
SUPERCLASS
object
INSTANCE VARIABLES
duration
is the duration of the loop in seconds. Each iteration through the loop increments the loop's time
by 1 / resolution.
resolution
is the number of ticks per second.
MESSAGES
start! sets the loop's time to 0.0, executes its
start_actions
, executes its tick_actions
until
duration
is exceeded and then executes its
end_actions.
stop! suspends the execution of a loop. Use continue!
to resume execution.
compile_on!
Uses compiled actions for the start, tick, and end
actions.
compile_off!
Uses normal actions instead of compiled actions.
assume_static_objects_[on|off]!
Sends the appropriate message to the actions
objects.
continue!
resumes a loop that has been stopped.
end! exits a loop and performs it's end actions.
exit! exits a loop without performing it's end actions.
increment!
increments a loop's time by 1.0 / resolution.
EXAMPLE
/* create a loop */
loop new: l
resolution=1
duration=10
start_actions="! starting loop"
tick_actions="l print: time;"
end_actions="! loop complete"
end_actions+"l print: time;"
;
/* start the loop */
l start!;
SEE ALSO
actions scene cue ui_scene motif_scene
Please send comments and suggestions toconsult@rpi.edu