diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-04-12 14:38:00 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-06-10 14:00:12 +1000 |
commit | 0949d1b7f5f3c56955a86835b3455b8c47a1510e (patch) | |
tree | b83a515338a475698042c4c03420e4f3d326019f /jim_tcl.txt | |
parent | 34351d354006c44bd6fc21f1d509b7996d88004f (diff) | |
download | jimtcl-0949d1b7f5f3c56955a86835b3455b8c47a1510e.zip jimtcl-0949d1b7f5f3c56955a86835b3455b8c47a1510e.tar.gz jimtcl-0949d1b7f5f3c56955a86835b3455b8c47a1510e.tar.bz2 |
Add TclX-compatible loop command
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim_tcl.txt')
-rw-r--r-- | jim_tcl.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/jim_tcl.txt b/jim_tcl.txt index dc16815..1bf20dd 100644 --- a/jim_tcl.txt +++ b/jim_tcl.txt @@ -64,6 +64,7 @@ Changes between 0.70 and 0.71 4. Support +jimsh --version+ 5. Additional variables in +tcl_platform()+ 6. 'local' procs now push existing commands and 'upcall' can call them +7. Add 'loop' command (TclX compatible) Changes between 0.63 and 0.70 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2741,6 +2742,19 @@ than waiting until garbage collection. ... } +loop +~~~~ ++*loop* 'var first limit ?incr? body'+ + +Similar to 'for' except simpler and possibly more efficient. +With a positive increment, equivalent to: + + for {set var $first} {$var < $limit} {incr var $incr} $body + +If *incr* is not specified, 1 is used. +Note that setting the loop variable inside the loop does not +affect the loop count. + lindex ~~~~~~ +*lindex* 'list index'+ |