#5, First Floor, 4th Street , Dr. Subbarayan Nagar, Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to write the procedure in ns2?
  • Procedure can be written in tcl using the following command
  • Example1: Without Arguments

    add1
    set a 10
    set b 15
    proc add1 {}
    {
    global a b
    set value [expr $a+$b]
    puts "value = $value"
    }

  • Example2: With Arguments

    add2 10 20
    proc add2 {p q}
    {
    global ns
    set result [expr $p*$q]
    puts "result=$result"
    }