As per our previous article, we learned what is Tcl language and uses of it.In this article, we going to explore syntax and basics of Tcl.
Local Environment Setup
If you are willing to set up your environment for Tcl, you need the following two software applications available on your computer −Text Editor (Notepad++ or Notepad or any other Text editor)
Tcl Interpreter (Download TCL Package: Linux/Mac/Unix, Windows)
I am just continuing this tutorial with Windows Operating system for user convenience.
Windows Setup
1)Download IronTcl package.
2)Extract to C partition (c:/)
3) Now go to
Control Panel>System and Security>System>Advanced System Seting>Advance>Environmnt Variables
Control Panel>System and Security>System>Advanced System Seting>Advance>Environmnt Variables
Click "New" in Variable name type "PATH" in variable value type "C:\IronTcl\bin"
then OK > OK > OK.
Now you can access the Tcl application over the cmd.Open cmd and type tclsh86t and hit enter you will get response fromTcl application.
BASIC TCL SCRIPT TEST
1)Create Folder called Tcl-Scripts in Desktop
2)Open Notepad or any other text editor and type below commands
then OK > OK > OK.
Now you can access the Tcl application over the cmd.Open cmd and type tclsh86t and hit enter you will get response fromTcl application.
BASIC TCL SCRIPT TEST
1)Create Folder called Tcl-Scripts in Desktop
2)Open Notepad or any other text editor and type below commands
(puts will act as printing function, it is a basic printing script)
3) "save as" Test.tcl into Tcl-Scripts folder.
4) Open cmd and change directory to Desktop/Tcl-Scripts
5)now execute Test.tcl in cmd with help of Tcl application. (follow the image).
If the program print hello World as output, Installed Tcl application working successfully without any issue.
In our next article, we will see how to use values and variables in Tcl language.