08-09-2009
2,
0
Join Date: Aug 2009
Last Activity: 9 August 2009, 11:08 PM EDT
Posts: 2
Thanks Given: 0
Thanked 0 Times in 0 Posts
help a newbie programmer tcl
Prompt please where the error occurred.
text.txt obtained by ls-lah> text.txt
proc file_to_mas {name_file} {
set fileid [open $name_file r+]
seek $fileid 0 start
global mas
set mas(0) 1
for {set i 0} {![eof $fileid]} {incr i} {
gets $fileid mas(i);
puts $mas(i) }
close $fileid;}
file_to_mas {text.txt}
puts "\n...................................\n"
puts $mas(0)
puts $mas(1) ;#why mas (0) and mas(1) Local?