Monday, 24 August 2015

Tool Command Language - lecture 4 (Decision making and branching )

1. if - else

The syntax of if-else in tcl is as.
if { statement 1 } {statement 2} else {statement 3}
example
set x 10
if { $x == 2 } {puts "hello } else { puts "bye" }
  will print bye
we can also write it like 
if { $x == 2 } {
puts "hello 
else {
 puts "bye" 
 }

No comments:

Post a Comment

Grammar Mistakes in Technical Paper Writing

Let me share some experience in this post with you. I'm currently in the second year of my Ph.D. program. We are in the middle of paper...