Re: Optimizing TCL Code
- From: suchenwi <richard.suchenwirth-bauersachs@xxxxxxxxxxx>
- Date: Wed, 5 Nov 2008 07:40:43 -0800 (PST)
On 5 Nov., 10:50, "Donal K. Fellows" <donal.k.fell...@xxxxxxxxx>
wrote:
If the file is "large" (where that term is something that is
highly dependent on the data) then you might be better off using a
while loop with [gets]. (If you do that, remember to put the [eof]
test *after* the [gets]!)
The usual idiom is:
set f [open $filename]
while {[gets $f line] >= 0} { #-- this is the test for EOF
do something with $line
}
close $f
.
- References:
- Optimizing TCL Code
- From: r_canor
- Re: Optimizing TCL Code
- From: Donal K. Fellows
- Optimizing TCL Code
- Prev by Date: Re: Optimizing TCL Code
- Next by Date: Resizing images in a Tcl script
- Previous by thread: Re: Optimizing TCL Code
- Next by thread: Re: Optimizing TCL Code
- Index(es):