I am currently writing a Tcl script for NS2 where things are added to a list via the lset x 0 end+1 $item command in Tcl. See below the below test script:
set x { {} {} {} }
set refID 1
proc addValue {value} {
global x refID
set value [expr $value*2]
lset x $refID end+1 $value
}
addValue 7
addValue 8
# => {} {14 16} {}
Works perfect! The problem is that this is written using Tcl 8.6 by running the command tclsh test.tcl. The actual code I am trying to run is run using NS2 with Tcl version 8.5. Tcl 8.5 does not support the lset end function. How can I update Ns2 to run on Tcl 8.6? I have 8.6 on my computer; I just do not know how to get Ns2 to use it instead of 8.5. Using the lset in this way would save me quite a bit of time and a bunch of code.
Thank you