Coder Social home page Coder Social logo

tcl's Introduction

tcl

This repo holds the basic programs and practice for tcl.

Introduction:

TCL is a short form for a "tickle", it is a scripting language used to make the process easier and fast. You can start using it by typing "tclsh" on your linux or windows powershell terminal.

Set variables and printing it with string

puts : to print the data

puts "hello world";

Result:

hello world

set : to set the variable.

set str "this is str";
puts "$str"; 

Result:

this is str

Example:

set value 1.5; 
puts "the value is $value"; 

Result

 the value is 1.5

Command Interpolation

Command Interpolation means doing task in a single command instead of two sperate commands.
Using [] brackets:

set a 5; 
set b $b; # This will assign the value of b to a 
set b [set a 5]; # Only one command can also do the same job

Using { } bracket:
Use of these curly brackets will print all the text written inside the brackets as it is.

set var 5; 
puts "number $var"; 
puts {number $var};

Result

number 5
number $var

Arithmetic, bitwise and logical operations

Arithmetic, bitwise and logical operations can be done using 'expr' statement.
Example of addition of two integer variables a and b.

set a 4;
set b 6; 
set c [expr "$a + $b"]; 
puts "Addition of a and b is $c";

Result:

Addition of a and b is 10

More in progress

tcl's People

Contributors

zeeshanrafique23 avatar

Stargazers

Tharun avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.