MTK Android Based Phone IMEI Write Tool, DirecTV Now Launch Will Include Zero Rated Bandwidth on the Mobile Network, video entertainment product with a heavy mobile, Smartphone Apps Drive Content Usage, It will not surprise you that smartphones now are the ways most people interact with the Internet, Social Networking Web Server via Arbitrary Code Execution, Released Add New Method FOR Reset FRP Samsung

Tuesday, August 7, 2012

All New First Tcl script for beginners: "Hello World"

All New First Tcl script for beginners: "Hello World" - do you know that every day there are new gadgets that are created with new advantages to simplify your life, on the blog Gadget Center we will discuss about the latest gadgets and gadgets that have long ranging from speck and price, now we will discuss about All New First Tcl script for beginners: "Hello World" we have collected a lot of news to make this article to be really useful for you, please see.

Articles : All New First Tcl script for beginners: "Hello World"
full Link : All New First Tcl script for beginners: "Hello World"

You can also see our article on:


All New First Tcl script for beginners: "Hello World"

Hope you all have installed ns2 , now we can go for coding
As the ns2 simulations work on tcl scripts so we should know about tcl
Here some simple steps to write the "hello world" program in tcl

we can write tcl codes in two ways in interactive mode and in batch mode

first we can have look to interactive mode 

1.open the terminal
             type  $ ns
2. a command prompt open
         Create a new simulator object by using the command
                        set ns [ new Simulator ]

This is Usually the first non-comment statement in ns-2 script 
- Initialize the packet format
   - Create a scheduler (default is a calendar scheduler)
   - Create a “null agent”

3.  to print text on screen we use puts command
               $ns at 1 "puts "\Hello World\""
    here we Schedule an event to write at the time 1 
      by this script simulator instance "ns" writes "hello World"
4.  now we have to exit the simulator object
                         $ns at 1.5 "exit"

 5. now we have to run the simulator object,
                      $ns run
this starts ns
           
and this prints hello world

In batch mode  its much simple

open a text editor and write the codes there and save it with .tcl  file extention 

 expamlpe

 hello.tcl :

set ns [new Simulator]
$ns at 1 "puts \"hello world\""
$ns at 1.5 "exit"
$ns run

open the terminal and execute the hello.tcl by
            $ ns hello.tcl
 














article titled All New First Tcl script for beginners: "Hello World" has been completed in the discussion

hopefully information about All New First Tcl script for beginners: "Hello World" can provide benefits for you in determining the gadget to suit your needs so much easier in living everyday life.

you just read the article entitled All New First Tcl script for beginners: "Hello World" if you feel this information is useful for you and want to bookmark it or want to share it please use link https://mjoaobrum.blogspot.com/2012/08/all-new-first-tcl-script-for-beginners.html.

Tag :
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : All New First Tcl script for beginners: "Hello World"

0 comments:

Post a Comment