| 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 |
.TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures" |
| 8 |
.so man.macros |
| 9 |
.BS |
| 10 |
.SH NAME |
| 11 |
Tcl_RecordAndEvalObj \- save command on history list before evaluating |
| 12 |
.SH SYNOPSIS |
| 13 |
.nf |
| 14 |
\fB#include <tcl.h>\fR |
| 15 |
.sp |
| 16 |
int |
| 17 |
\fBTcl_RecordAndEvalObj\fR(\fIinterp, cmdPtr, flags\fR) |
| 18 |
.SH ARGUMENTS |
| 19 |
.AS Tcl_Interp *interp |
| 20 |
.AP Tcl_Interp *interp in |
| 21 |
Tcl interpreter in which to evaluate command. |
| 22 |
.AP Tcl_Obj *cmdPtr in |
| 23 |
Points to a Tcl value containing a command (or sequence of commands) |
| 24 |
to execute. |
| 25 |
.AP int flags in |
| 26 |
An OR'ed combination of flag bits. \fBTCL_NO_EVAL\fR means record the |
| 27 |
command but do not evaluate it. \fBTCL_EVAL_GLOBAL\fR means evaluate |
| 28 |
the command at global level instead of the current stack level. |
| 29 |
.BE |
| 30 |
|
| 31 |
.SH DESCRIPTION |
| 32 |
.PP |
| 33 |
\fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event |
| 34 |
on the history list and then execute it using \fBTcl_EvalObjEx\fR |
| 35 |
(or \fBTcl_GlobalEvalObj\fR if the \fBTCL_EVAL_GLOBAL\fR bit is set |
| 36 |
in \fIflags\fR). |
| 37 |
It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_EvalObjEx\fR, |
| 38 |
as well as a result value containing additional information |
| 39 |
(a result value or error message) |
| 40 |
that can be retrieved using \fBTcl_GetObjResult\fR. |
| 41 |
If you do not want the command recorded on the history list then |
| 42 |
you should invoke \fBTcl_EvalObjEx\fR instead of \fBTcl_RecordAndEvalObj\fR. |
| 43 |
Normally \fBTcl_RecordAndEvalObj\fR is only called with top-level |
| 44 |
commands typed by the user, since the purpose of history is to |
| 45 |
allow the user to re-issue recently invoked commands. |
| 46 |
If the \fIflags\fR argument contains the \fBTCL_NO_EVAL\fR bit then |
| 47 |
the command is recorded without being evaluated. |
| 48 |
|
| 49 |
.SH "SEE ALSO" |
| 50 |
Tcl_EvalObjEx, Tcl_GetObjResult |
| 51 |
|
| 52 |
.SH KEYWORDS |
| 53 |
command, event, execute, history, interpreter, value, record |