Generated from auxil.tcl with ROBODoc v3.2.4 on Wed May 25 16:04:51 2005
NAME
repeat
USAGE
repeat ntimes script
PURPOSE
This proc is for repetitive execution of a script supllied by
"script" argument. For example:
repeat 10 { puts "Hello !!!" }
will print "Hello !!!" 10-times. The repeat is nothing else then
simplified "for" loop. Above example could be also achieved by:
for {set i 0} {$i < 10} {incr i} {
puts "Hello !!!"
}
SIDE EFFECTS
Inside repeat scripts, the "repeat" variable have the value of the current
repeat-iteration. For example:
repeat 4 { puts "This is the $repeat. iteration !!!" }
will print:
This is the 1. iteration
This is the 2. iteration
This is the 3. iteration
This is the 4. iteration
ARGUMENTS
ntimes -- how many times to execute a script
script -- script to execute
RETURN VALUE
Undefined.
EXAMPLE
repeat 10 {
scripting::rotate x 5
scripting::makeMovie::makeFrame
}
SOURCE
proc repeat {ntimes script} {
global repeat_script repeat
set repeat_script $script
for {set repeat 1} {$repeat <= $ntimes} {incr repeat} {
uplevel 1 {eval $repeat_script}
}
}
NAME
wait
USAGE
wait ms
PURPOSE
This proc is similar to the Tcl command "after ms". However before
waiting for period of ms milliseconds, it updates all the events
(the after command does not make the update before waiting !!!)
ARGUMENTS
ms -- waiting time in milliseconds
RETURN VALUE
Undefined.
EXAMPLE
wait 500
SOURCE
proc wait {ms} {
if { ! [string is integer $ms] } {
ErrorIn wait "expected integer, but got $ms"
return
}
update
after $ms
}
NAME
putsFlush -- Tcl "puts" + "flush"
USAGE
putsFlush ?-nonewline? ?channelId? string
DESCRIPTION
Identical to Tcl's puts, but invoke the flush immediately after.
See puts man-page of Tcl.