1 | '\" |
---|
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.8 2007/12/13 15:22:31 dgp 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 <tcl.h>\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. \fBTCL_NO_EVAL\fR means record the |
---|
29 | command but do not evaluate it. \fBTCL_EVAL_GLOBAL\fR 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_EvalObjEx\fR |
---|
37 | (or \fBTcl_GlobalEvalObj\fR if the \fBTCL_EVAL_GLOBAL\fR bit is set |
---|
38 | in \fIflags\fR). |
---|
39 | It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_EvalObjEx\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 do not want the command recorded on the history list then |
---|
44 | you should invoke \fBTcl_EvalObjEx\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 \fBTCL_NO_EVAL\fR bit then |
---|
49 | the command is recorded without being evaluated. |
---|
50 | |
---|
51 | .SH "SEE ALSO" |
---|
52 | Tcl_EvalObjEx, Tcl_GetObjResult |
---|
53 | |
---|
54 | .SH KEYWORDS |
---|
55 | command, event, execute, history, interpreter, object, record |
---|