OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tcl8.6.12 / doc / RecordEval.3
1 '\"
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 .TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures"
9 .so man.macros
10 .BS
11 .SH NAME
12 Tcl_RecordAndEval \- save command on history list before evaluating
13 .SH SYNOPSIS
14 .nf
15 \fB#include <tcl.h>\fR
16 .sp
17 int
18 \fBTcl_RecordAndEval\fR(\fIinterp, cmd, flags\fR)
19 .SH ARGUMENTS
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.
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_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.
45 .PP
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.
50
51 .SH "SEE ALSO"
52 Tcl_RecordAndEvalObj
53
54 .SH KEYWORDS
55 command, event, execute, history, interpreter, record