Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
そのようなループを使用して変数を作成しました:
for {set i 0} {$i<5} {incr i} { set n($i) [$ns node] }
何らかの手順で n($i) 変数を呼び出す方法は? 私はそれを
global n(0) n(1) n(2) n(3) n(4)
しかし、私はエラーが発生しました:
ns: レコード: 不正な変数名 "n(0)": upvar は、実行中に配列要素のように見えるスカラー変数を作成しません
global n 配列変数 n を呼び出すには: で十分であることがわかりました。
global n