XCrySDen --
(X-Window)
	      CRYstalline Structures and DENsities

[Figure]
Home | About | Description | Documentation | Download | News | Links
XCrySDen Scripting Documentation

Table of Contents
    Scripting/repeat
    Scripting/wait
    auxil/putsFlush


Generated from auxil.tcl with ROBODoc v3.2.4 on Wed May 25 16:04:51 2005


Scripting/repeat

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}
        }
    }

Scripting/wait

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
    }

auxil/putsFlush

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.

Home | About | Description | Documentation | Download | News | Links
Webmaster: Tone Kokalj
This document was last modified on Wed Oct 7 16:12:17 CEST 2015