1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1989-1993 The Regents of the University of California.
|
3 |
|
|
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
4 |
|
|
'\"
|
5 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
6 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
7 |
|
|
'\"
|
8 |
|
|
'\" RCS: @(#) $Id: RecordEval.3,v 1.1.1.1 2002-01-16 10:25:24 markom Exp $
|
9 |
|
|
'\"
|
10 |
|
|
.so man.macros
|
11 |
|
|
.TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures"
|
12 |
|
|
.BS
|
13 |
|
|
.SH NAME
|
14 |
|
|
Tcl_RecordAndEval \- save command on history list before evaluating
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
.nf
|
17 |
|
|
\fB#include \fR
|
18 |
|
|
.sp
|
19 |
|
|
int
|
20 |
|
|
\fBTcl_RecordAndEval\fR(\fIinterp, cmd, flags\fR)
|
21 |
|
|
.SH ARGUMENTS
|
22 |
|
|
.AS Tcl_Interp *interp;
|
23 |
|
|
.AP Tcl_Interp *interp in
|
24 |
|
|
Tcl interpreter in which to evaluate command.
|
25 |
|
|
.AP char *cmd in
|
26 |
|
|
Command (or sequence of commands) 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_RecordAndEval\fR is invoked to record a command as an event
|
36 |
|
|
on the history list and then execute it using \fBTcl_Eval\fR
|
37 |
|
|
(or \fBTcl_GlobalEval\fR if the TCL_EVAL_GLOBAL bit is set in \fIflags\fR).
|
38 |
|
|
It returns a completion code such as TCL_OK just like \fBTcl_Eval\fR
|
39 |
|
|
and it leaves information in \fIinterp->result\fR.
|
40 |
|
|
If you don't want the command recorded on the history list then
|
41 |
|
|
you should invoke \fBTcl_Eval\fR instead of \fBTcl_RecordAndEval\fR.
|
42 |
|
|
Normally \fBTcl_RecordAndEval\fR is only called with top-level
|
43 |
|
|
commands typed by the user, since the purpose of history is to
|
44 |
|
|
allow the user to re-issue recently-invoked commands.
|
45 |
|
|
If the \fIflags\fR argument contains the TCL_NO_EVAL bit then
|
46 |
|
|
the command is recorded without being evaluated.
|
47 |
|
|
.PP
|
48 |
|
|
Note that \fBTcl_RecordAndEval\fR has been largely replaced by the
|
49 |
|
|
object-based procedure \fBTcl_RecordAndEvalObj\fR.
|
50 |
|
|
That object-based procedure records and optionally executes
|
51 |
|
|
a command held in a Tcl object instead of a string.
|
52 |
|
|
|
53 |
|
|
.SH "SEE ALSO"
|
54 |
|
|
Tcl_RecordAndEvalObj
|
55 |
|
|
|
56 |
|
|
.SH KEYWORDS
|
57 |
|
|
command, event, execute, history, interpreter, record
|