📄 26.html
字号:
<HTML><TITLE>Basic Syntax and I/O: Double Quotes</TITLE><BODY BGCOLOR="#FFF0E0" VLINK="#0FBD0F" TEXT="#101000" LINK="#0F0FDD">
<A NAME="top"><H1>Double Quotes</H1></A>
<P> Double quotes in Tcl have a meaning that is both familiar and strange. Often,
they are used to define strings, as in <TT>"Hello World"</TT> – that is what is
familiar. A cleaner way to write the same string is usually <TT>{Hello
World}</TT> -- that is what is strange.
<P> You saw the use of curly brackets in the previous section. Double quotes are
much the same but different in that:
<UL>
<P> <P><LI> When an argument is surrounded by double quotes, substitutions <CITE>are</CITE>
performed – use the curly brackets when you do not want substitution and use
double quotes when you do.
<P> <P><LI> Curly brackets can be nested whereas double quotes cannot.
</UL>
<DL><DD> <CITE>Be aware that it is what surrounds your argument that determines
whether curly-bracket or double-quote processing will apply.</CITE>
<P> </DL>
<P> <P><A NAME="2.6a">
<STRONG>Exercise 2.6a</STRONG> </A><DL><DD>
What is output by the following?
<PRE>
set X Hello
puts {$X World}
puts "$X World"
puts { {Hello} {World} }
puts " {Hello} {World} "
</PRE>
<P>
<A HREF="2.11.html#Sol2.6a" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/2.11.html#Sol2.6a">Solution</A></DL>
<!-- Linkbar -->
<P><CENTER><FONT SIZE=2><NOBR>
<STRONG>From</STRONG>
<A HREF="javascript:if(confirm('http://www.mapfree.com/sbf/tcl/book/home.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.mapfree.com/sbf/tcl/book/home.html'" tppabs="http://www.mapfree.com/sbf/tcl/book/home.html">Tcl/Tk For Programmers</A><WBR>
<STRONG>Previous</STRONG>
<A HREF="2.5.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/2.5.html">section</A><WBR>
<STRONG>Next</STRONG>
<A HREF="2.7.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/2.7.html">section</A><WBR>
<STRONG>All</STRONG>
<A HREF="2.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/2.html">sections</A><WBR>
<STRONG>Author</STRONG>
<A HREF="javascript:if(confirm('http://www.mapfree.com/mp/jaz/home.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.mapfree.com/mp/jaz/home.html'" tppabs="http://www.mapfree.com/mp/jaz/home.html">J. A. Zimmer</A><WBR>
<STRONG>Copyright</STRONG>
<A HREF="copyright.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/copyright.html">Notice</A><WBR>
<P>
<I>Jun 17, 1998</I>
</NOBR></FONT></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -