Sunday, June 9, 2013

TCL Tutorials -Expressions


ex_expression.tcl


set r 2.0
set pi [expr { 4 * atan(1.0) }]
set area [expr {$pi * $r * $r}]

puts "r      : $r"
puts "pi     : $pi"
puts "area     : $area"

Friday, June 7, 2013

TCL Tutorials - Quoting


An Example of how to use quotes in tcl


ex_quoting.tcl

set years 32
set years_sub "I am $years";
set years_no_sub {I am $years};

puts "this string got substituted - weak quoting"
puts $years_sub

puts "this string did not substitute - rigid quoting"
puts $years_no_sub

Wednesday, June 5, 2013

TCL Tutorials - Line Continuation


This examples states the use of line continuation

ex_02.tcl

set members { \
abc \
def \
ghi \
jkl \
}
puts $members

Tuesday, June 4, 2013

TCL Tutorials- Comments

I am starting TCL tutorials and will be posting it on a daily basis

comment_example.tcl


#this is a comment

set real_years 4
set dog_name "spot"; #another comment
set dog_years [expr (7*$real_years)]

puts "my dog $dog_name is $real_years"
puts "he acts $dog_years old"