Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements

Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements - welcome to our blog that presents the full content How Gadget, the discussion this time we're discussing that you find that Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements, we have provided complete information with images that are easy to understand, the explanation is simple but complete, therefore please read until the end :)

This is about : Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements
And this article : Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements

You can also see our article on:


Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements


For loops

For loops are very useful in ns and can be used in conjunction with arrays to easily create larger network topologies. To generate 100 nodes, the following code can be used:
for {set i 0}{$i < 100}{incr i} {
    set n($i) [$ns node]
}

While loops

These are very similar to for loops. The syntax is
set i 0
while {$i < 10} {
    set n($i) [new Node]
    incr i
}

If statements

If statements are very simple
if {$i < 10} {
    puts "i is less than 10"
}
if {$var2 == "Tcl Variable 2"} {
    puts "var2 = Tcl Variable 2"
}


Information Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements has been completed we present

A few of our information about the Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements, we hope you benefit from this article

You have just read the article Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements and many articles about gadget in our blog this, please read it. and url link of this article is https://howtomonetizeeverything.blogspot.com/2012/12/tcl-and-otcl-tutorial-for-ns2-loops-and.html Hopefully discussion articles on provide more knowledge about the world of tech gadgets.

Tag :

0 Response to "Tcl and OTcl Tutorial For NS2 -Loops and Conditional Statements"

Post a Comment