Posted to tcl by ohno at Sat Mar 09 13:36:07 GMT 2013view raw
- ;# Show how a \ affects the $
- set Z "Albany"
- set Z_LABEL "The Capitol of New York is: "
-
- puts "$Z_LABEL $Z"
- puts "$Z_LABEL \$Z"
-
- ;# The next line needs a backslash to escape the '$'
- puts "\nBen Franklin is on the $100.00 bill"
-
- set a 100.00
- puts "Washington is not on the $a bill" ;# This is not what you want
- puts "Lincoln is not on the $$a bill" ;# This is OK
- puts "Hamilton is not on the \$a bill" ;# This is not what you want
- puts "Ben Franklin is on the \$$a bill" ;# But, this is OK
-
- puts "\n................. examples of escape strings"
- puts "Tab\tTab\tTab"
- puts "This string prints out \non two lines"
- puts "This string comes out\
- on a single line"
-