Variable Declaration
In c prog language when we declare some variable , we writeint x = 3;
But in Tcl we write
set x 3;
"here it is stored as string"
No need to declare just assign a value to variable. This statement will create a variable name x and store it as string.
Now if we write
puts [expr $x + 5] # we can also use (put)
here x is automatically converted into int.
Now to print x we will write
puts $x .. Answer will be 8 ( as expr above does addition operation)
No comments:
Post a Comment