DVloop
Synopsis
execute an object n times using for loop-like controls
module DVloop {
link+notify+IPort2 trigger;
float+Iparam start;
float+Iparam end;
float+Iparam incr;
float+Oparam count;
int+Oparam done;
method+notify_val+notify_inst loop_update = "DVloop_update";
};
Description
DVloop is a for/Do loop mechanism. It provides a way to iteratively execute an object. The basic structure is:for ( count = start; count < end; count = count + incr )Note: DVloop cannot be interrupted. You will likely want to use the almost identical, but interruptible Templates.GMOD.loop instead.
Input
trigger
A link. When the object that this is connected to changes, DVloop begins to execute its for loop. For example, this could be connected to UItoggle.
start
A float. Sets the initial value of the for loop control variable. It is the "for (count = start" clause.
end
A float. Sets the terminal value of the for loop's control variable. It is the "end" in "for ( count = start; count <end".
incr
A float. Sets the increment to the for loop's control variable. It is the "incr" in "for (count = start; count < end; count=count+incr". It must be non-zero.
count
A float. This contains the current value of the for loop's control variable. It is the "count" in the "for ( count = start" clause.
DVadvect, for example, uses count to set its time step input.
done
An integer. When this is set to 1, the loop has finished executing.
Example
Not available.
File
v/dv.v
modules/loop.c
See also