global varabile that returns the number of lines in a file?

Old posts that have not been replied to for several years.
Locked
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

global varabile that returns the number of lines in a file?

Post by Dedan »

Is there a global varabile that returns the number of lines in a file?
I once was an intelligent young man, now i am old and i can not remember who i was.
M
Meltdown

Post by Meltdown »

nope afaik
but its quite easy:

set c 0; set f [open search.txt r] ; while {![eof $f]} {gets $f ; incr c} ; return $c
Locked