1# foreach.tcl -- 2# 3# Test file for compilation. 4# Contains nested foreach loops, used to check generation of the exception 5# ranges arrays. 6# 7# Copyright (c) 1998-2000 by Ajuba Solutions. 8# 9# See the file "license.terms" for information on usage and redistribution 10# of this file, and for a DISCLAIMER OF ALL WARRANTIES. 11# 12# RCS: @(#) $Id: foreach.tcl,v 1.2 2000/05/30 22:19:11 wart Exp $ 13 14set result {} 15set top 8 16 17set outer {} 18set inner {} 19 20for {set idx 0} {$idx < $top} {} {lappend outer [incr idx]} 21 22foreach outerCounter $outer { 23 append result $outerCounter 24 lappend inner $outerCounter 25 26 foreach innerCounter $inner { 27 append result . 28 } 29} 30 31append result DONE 32set result 33