1. In Tcl or Wish shell, type following commands. Pay attention to the results of each command line
1. In Tcl or Wish shell, type following commands. Pay attention to the results of each command line
puts stdout {Hello, World!}
set var 5
set b $var
expr 7.2/3
set pi [expr 2*asin(1.0)]
puts stdout pi
puts stdout $pi
puts stdout "$pi"
puts stdiout {$pi}
set dollar \$
set x $dollar
set s Hello
puts stdout "The length of $s is [string length $s]."
puts stdout {The length of $s is [string length $s].}
foreach num {1 2 3 4 5 } {puts stdout $num }
foreach num {1 2 3 4 5 } {set a [expr $num*$num]; puts stdout $a }
Nhận xét
Đăng nhận xét