2 '\" Copyright (c) 1993 The Regents of the University of California.
3 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4 '\" Copyright (c) 2000 Scriptics Corporation.
6 '\" See the file "license.terms" for information on usage and redistribution
7 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
9 .TH source n "" Tcl "Tcl Built-In Commands"
10 .\" The -*- nroff -*- definitions below are for supplemental macros used
11 .\" in Tcl/Tk manual entries.
13 .\" .AP type name in/out ?indent?
14 .\" Start paragraph describing an argument to a library procedure.
15 .\" type is type of argument (int, etc.), in/out is either "in", "out",
16 .\" or "in/out" to describe whether procedure reads or modifies arg,
17 .\" and indent is equivalent to second arg of .IP (shouldn't ever be
18 .\" needed; use .AS below instead)
21 .\" Give maximum sizes of arguments for setting tab stops. Type and
22 .\" name are examples of largest possible arguments that will be passed
23 .\" to .AP later. If args are omitted, default tab stops are used.
26 .\" Start box enclosure. From here until next .BE, everything will be
27 .\" enclosed in one large box.
30 .\" End of box enclosure.
33 .\" Begin code excerpt.
38 .\" .VS ?version? ?br?
39 .\" Begin vertical sidebar, for use in marking newly-changed parts
40 .\" of man pages. The first argument is ignored and used for recording
41 .\" the version when the .VS was added, so that the sidebars can be
42 .\" found and removed when they reach a certain age. If another argument
43 .\" is present, then a line break is forced before starting the sidebar.
46 .\" End of vertical sidebar.
49 .\" Begin an indented unfilled display.
52 .\" End of indented unfilled display.
55 .\" Start of list of standard options for a Tk widget. The manpage
56 .\" argument defines where to look up the standard options; if
57 .\" omitted, defaults to "options". The options follow on successive
58 .\" lines, in three columns separated by tabs.
61 .\" End of list of standard options for a Tk widget.
63 .\" .OP cmdName dbName dbClass
64 .\" Start of description of a specific option. cmdName gives the
65 .\" option's name as specified in the class command, dbName gives
66 .\" the option's name in the option database, and dbClass gives
67 .\" the option's class in the option database.
70 .\" Print arg1 underlined, then print arg2 normally.
73 .\" Print arg1 in quotes, then arg2 normally (for trailing punctuation).
76 .\" Print an open parenthesis, arg1 in quotes, then arg2 normally
77 .\" (for trailing punctuation) and then a closing parenthesis.
79 .\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
83 .\" # Start an argument description
87 . ie !"\\$2"" .TP \\n()Cu
92 \&\\$1 \\fI\\$2\\fP (\\$3)
105 .\" # define tabbing values for .AP
108 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
111 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
112 .nr )C \\n()Bu+\\w'(in/out)'u+2n
114 .AS Tcl_Interp Tcl_CreateInterp in/out
115 .\" # BS - start boxed text
116 .\" # ^y = starting y location
124 .if n \l'\\n(.lu\(ul'
127 .\" # BE - end boxed text (draw box now)
132 .ie n \l'\\n(^lu\(ul'
134 .\" Draw four-sided box normally, but don't draw top of
135 .\" box if the box started on an earlier page.
137 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
140 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
147 .\" # VS - start vertical sidebar
148 .\" # ^Y = starting y location
149 .\" # ^v = 1 (for troff; for nroff this doesn't matter)
153 .ie n 'mc \s12\(br\s0
156 .\" # VE - end of vertical sidebar
164 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
171 .\" # Special macro to handle page bottom: finish off current
172 .\" # box/sidebar if in box/sidebar mode, then invoked standard
173 .\" # page bottom macro.
180 .\" Draw three-sided box if this is the box's first page,
181 .\" draw two sides but no top otherwise.
182 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
183 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
186 .nr ^x \\n(^tu+1v-\\n(^Yu
187 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
200 .\" # DS - begin display
206 .\" # DE - end display
212 .\" # SO - start of list of standard options
214 'ie '\\$1'' .ds So \\fBoptions\\fR
215 'el .ds So \\fB\\$1\\fR
216 .SH "STANDARD OPTIONS"
222 .\" # SE - end of list of standard options
227 See the \\*(So manual entry for details on the standard options.
229 .\" # OP - start of full description for a single option
234 Command-Line Name: \\fB\\$1\\fR
235 Database Name: \\fB\\$2\\fR
236 Database Class: \\fB\\$3\\fR
240 .\" # CS - begin code excerpt
246 .\" # CE - end code excerpt
251 .\" # UL - underline word
255 .\" # QW - apply quotation marks to word
257 .ie '\\*(lq'"' ``\\$1''\\$2
258 .\"" fix emacs highlighting
259 .el \\*(lq\\$1\\*(rq\\$2
261 .\" # PQ - apply parens and quotation marks to word
263 .ie '\\*(lq'"' (``\\$1''\\$2)\\$3
264 .\"" fix emacs highlighting
265 .el (\\*(lq\\$1\\*(rq\\$2)\\$3
267 .\" # QR - quoted range
269 .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
270 .\"" fix emacs highlighting
271 .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
273 .\" # MT - "empty" string
278 '\" Note: do not modify the .SH NAME line immediately below!
280 source \- Evaluate a file or resource as a Tcl script
282 \fBsource \fIfileName\fR
284 \fBsource\fR \fB\-encoding \fIencodingName fileName\fR
288 This command takes the contents of the specified file or resource
289 and passes it to the Tcl interpreter as a text script. The return
290 value from \fBsource\fR is the return value of the last command
291 executed in the script. If an error occurs in evaluating the contents
292 of the script then the \fBsource\fR command will return that error.
293 If a \fBreturn\fR command is invoked from within the script then the
294 remainder of the file will be skipped and the \fBsource\fR command
295 will return normally with the result from the \fBreturn\fR command.
297 The end-of-file character for files is
299 (^Z) for all platforms.
300 The source command will read files up to this character. This
301 restriction does not exist for the \fBread\fR or \fBgets\fR commands,
302 allowing for files containing code and data segments (scripted documents).
305 in code for string comparison, you can use
309 which will be safely substituted by the Tcl interpreter into
312 The \fB\-encoding\fR option is used to specify the encoding of
313 the data stored in \fIfileName\fR. When the \fB\-encoding\fR option
314 is omitted, the system encoding is assumed.
317 Run the script in the file \fBfoo.tcl\fR and then the script in the
328 foreach scriptFile {foo.tcl bar.tcl} {
329 \fBsource\fR $scriptFile
333 file(n), cd(n), encoding(n), info(n)