2 '\" Copyright (c) 1989-1993 The Regents of the University of California.
3 '\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
5 '\" See the file "license.terms" for information on usage and redistribution
6 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 .TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures"
12 Tcl_RecordAndEval \- save command on history list before evaluating
15 \fB#include <tcl.h>\fR
18 \fBTcl_RecordAndEval\fR(\fIinterp, cmd, flags\fR)
20 .AS Tcl_Interp *interp
21 .AP Tcl_Interp *interp in
22 Tcl interpreter in which to evaluate command.
23 .AP "const char" *cmd in
24 Command (or sequence of commands) to execute.
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.
33 \fBTcl_RecordAndEval\fR is invoked to record a command as an event
34 on the history list and then execute it using \fBTcl_Eval\fR
35 (or \fBTcl_GlobalEval\fR if the \fBTCL_EVAL_GLOBAL\fR bit is set in \fIflags\fR).
36 It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_Eval\fR
37 and it leaves information in the interpreter's result.
38 If you do not want the command recorded on the history list then
39 you should invoke \fBTcl_Eval\fR instead of \fBTcl_RecordAndEval\fR.
40 Normally \fBTcl_RecordAndEval\fR is only called with top-level
41 commands typed by the user, since the purpose of history is to
42 allow the user to re-issue recently-invoked commands.
43 If the \fIflags\fR argument contains the \fBTCL_NO_EVAL\fR bit then
44 the command is recorded without being evaluated.
46 Note that \fBTcl_RecordAndEval\fR has been largely replaced by the
47 value-based procedure \fBTcl_RecordAndEvalObj\fR.
48 That value-based procedure records and optionally executes
49 a command held in a Tcl value instead of a string.
55 command, event, execute, history, interpreter, record