Posted to tcl by ohno at Sat Mar 09 13:36:07 GMT 2013view raw

  1. ;# Show how a \ affects the $
  2. set Z "Albany"
  3. set Z_LABEL "The Capitol of New York is: "
  4.  
  5. puts "$Z_LABEL $Z"
  6. puts "$Z_LABEL \$Z"
  7.  
  8. ;# The next line needs a backslash to escape the '$'
  9. puts "\nBen Franklin is on the $100.00 bill"
  10.  
  11. set a 100.00
  12. puts "Washington is not on the $a bill" ;# This is not what you want
  13. puts "Lincoln is not on the $$a bill" ;# This is OK
  14. puts "Hamilton is not on the \$a bill" ;# This is not what you want
  15. puts "Ben Franklin is on the \$$a bill" ;# But, this is OK
  16.  
  17. puts "\n................. examples of escape strings"
  18. puts "Tab\tTab\tTab"
  19. puts "This string prints out \non two lines"
  20. puts "This string comes out\
  21. on a single line"
  22.