Um, are you sure you're writing Tcl? This isn't the syntax for Tcl. What you might be looking for is:
for {set i 1} {$i < 100} {incr i} {
set ns [new Simulator]
....
....(my NS code)
....
$ns run
}
You use braces everywhere. The only time I can think of using brackets is for arrays, but I don't think I know Tcl deep enough to ascertain this, and your start conditions, test and next commands are in their own braces and incr i
is equivalent to i++
.
Now, new
is not a built-in function in Tcl. Do you have a proc named new
somewhere? If you don't, then you'll get errors.