projman/hlp/en/tcl/source.htm
2015-10-19 14:27:31 +04:00

33 lines
1.9 KiB
HTML

<HTML><HEAD><TITLE>Built-In Commands - source manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
source - Evaluate a file or resource as a Tcl script
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>source </B><I>fileName</I><BR>
<B>source</B> <B>-rsrc </B><I>resourceName </I>?<I>fileName</I>?<BR>
<B>source</B> <B>-rsrcid </B><I>resourceId </I>?<I>fileName</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This command takes the contents of the specified file or resource
and passes it to the Tcl interpreter as a text script. The return
value from <B>source</B> is the return value of the last command
executed in the script. If an error occurs in evaluating the contents
of the script then the <B>source</B> command will return that error.
If a <B><A HREF="../TkCmd/return.htm">return</A></B> command is invoked from within the script then the
remainder of the file will be skipped and the <B>source</B> command
will return normally with the result from the <B><A HREF="../TkCmd/return.htm">return</A></B> command.
The <I>-rsrc</I> and <I>-rsrcid</I> forms of this command are only
available on Macintosh computers. These versions of the command
allow you to source a script from a <B>TEXT</B> resource. You may specify
what <B>TEXT</B> resource to source by either name or id. By default Tcl
searches all open resource files, which include the current
application and any loaded C extensions. Alternatively, you may
specify the <I>fileName</I> where the <B>TEXT</B> resource can be found.
<H3><A NAME="M5">KEYWORDS</A></H3>
<A href="../Keywords/F.htm#file">file</A>, <A href="../Keywords/S.htm#script">script</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1993 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>