tcl脚本学习二:特殊符号学习

lesson 2 :特殊符号学习 !


example ① :

set Z "zhou li "
set Z_LABEL "boy "

puts "$Z_LABEL $Z"
puts "$Z_LABEL $Z"

// 可通过 将特殊符号输出,和C语言一样


example ② :

1. puts " I have $100.00 bill"
//如果这样会报错 :提示100.00非法 ps: 是换行
2.

set a 100.00

puts "I have $a bill" ;

//如果这样就不会报错


3.puts "Lincoln is not on the $$a bill" ;# This is OK
//如果在$前面再加一个$ ,将会把$输出

4.puts "Hamilton is not on the $a bill" ;# This is not what you want
//这种会输出$a bill

5.puts "Ben Franklin is on the $$a bill" ;# But, this is OK
//这种情况下可以

6.puts " ................. examples of escape strings"
//学习 是换行

7.puts "Tab Tab Tab"
//学习 是留空格

8.puts "This string prints out on two lines"
puts "This string comes out
on a single line"
//若一行写不完,可通过这种方式拼接

原文地址:https://www.cnblogs.com/gold-life/p/5731106.html