1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1997 Sun Microsystems, Inc.
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" RCS: @(#) $Id: RecEvalObj.3,v 1.1.1.1 2002-01-16 10:25:24 markom Exp $
|
8 |
|
|
'\"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures"
|
11 |
|
|
.BS
|
12 |
|
|
.SH NAME
|
13 |
|
|
Tcl_RecordAndEvalObj \- save command on history list before evaluating
|
14 |
|
|
.SH SYNOPSIS
|
15 |
|
|
.nf
|
16 |
|
|
\fB#include \fR
|
17 |
|
|
.sp
|
18 |
|
|
int
|
19 |
|
|
\fBTcl_RecordAndEvalObj\fR(\fIinterp, cmdPtr, flags\fR)
|
20 |
|
|
.SH ARGUMENTS
|
21 |
|
|
.AS Tcl_Interp *interp;
|
22 |
|
|
.AP Tcl_Interp *interp in
|
23 |
|
|
Tcl interpreter in which to evaluate command.
|
24 |
|
|
.AP Tcl_Obj *cmdPtr in
|
25 |
|
|
Points to a Tcl object containing a command (or sequence of commands)
|
26 |
|
|
to execute.
|
27 |
|
|
.AP int flags in
|
28 |
|
|
An OR'ed combination of flag bits. TCL_NO_EVAL means record the
|
29 |
|
|
command but don't evaluate it. TCL_EVAL_GLOBAL means evaluate
|
30 |
|
|
the command at global level instead of the current stack level.
|
31 |
|
|
.BE
|
32 |
|
|
|
33 |
|
|
.SH DESCRIPTION
|
34 |
|
|
.PP
|
35 |
|
|
\fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event
|
36 |
|
|
on the history list and then execute it using \fBTcl_EvalObj\fR
|
37 |
|
|
(or \fBTcl_GlobalEvalObj\fR if the TCL_EVAL_GLOBAL bit is set
|
38 |
|
|
in \fIflags\fR).
|
39 |
|
|
It returns a completion code such as TCL_OK just like \fBTcl_EvalObj\fR,
|
40 |
|
|
as well as a result object containing additional information
|
41 |
|
|
(a result value or error message)
|
42 |
|
|
that can be retrieved using \fBTcl_GetObjResult\fR.
|
43 |
|
|
If you don't want the command recorded on the history list then
|
44 |
|
|
you should invoke \fBTcl_EvalObj\fR instead of \fBTcl_RecordAndEvalObj\fR.
|
45 |
|
|
Normally \fBTcl_RecordAndEvalObj\fR is only called with top-level
|
46 |
|
|
commands typed by the user, since the purpose of history is to
|
47 |
|
|
allow the user to re-issue recently-invoked commands.
|
48 |
|
|
If the \fIflags\fR argument contains the TCL_NO_EVAL bit then
|
49 |
|
|
the command is recorded without being evaluated.
|
50 |
|
|
|
51 |
|
|
.SH "SEE ALSO"
|
52 |
|
|
Tcl_EvalObj, Tcl_GetObjResult
|
53 |
|
|
|
54 |
|
|
.SH KEYWORDS
|
55 |
|
|
command, event, execute, history, interpreter, object, record
|