|
|
1.1 root 1: '\" Copyright 1989 Regents of the University of California
2: '\" Permission to use, copy, modify, and distribute this
3: '\" documentation for any purpose and without fee is hereby
4: '\" granted, provided that this notice appears in all copies.
5: '\" The University of California makes no representations about
6: '\" the suitability of this material for any purpose. It is
7: '\" provided "as is" without express or implied warranty.
8: '\"
9: '\" $Header: /sprite/src/lib/tcl/RCS/Tcl_Expr.man,v 1.2 89/03/24 14:16:11 ouster Exp $ SPRITE (Berkeley)
10: '\"
11: .so \*(]ltmac.sprite
12: .HS Tcl_Expr tcl
13: .BS
14: .SH NAME
15: Tcl_Expr \- evaluate an expression
16: .SH SYNOPSIS
17: .nf
18: \fB#include <tcl.h>\fR
19: .sp
20: int
21: \fBTcl_Expr\fR(\fIinterp, string, valuePtr\fR)
22: .SH ARGUMENTS
23: .AS Tcl_Interp *interp
24: .AP Tcl_Interp *interp in
25: Interpreter in whose context to evaluate \fIstring\fR.
26: .AP char *string in
27: Expression to be evaluated.
28: .AP int *valuePtr out
29: The expression's (integer) value will be stored here.
30: .BE
31:
32: .SH DESCRIPTION
33: .PP
34: \fBTcl_Expr\fR is a utility procedure used by several of the Tcl commands.
35: Given a string whose contents are an expression of the form
36: accepted by the \fBexpr\fR command, this procedure evaluates
37: the expression and returns the integer result in \fI*valuePtr\fR.
38: Normally \fBTcl_Expr\fR returns \fBTCL_OK\fR as its result. However, if
39: the expression contains a syntax error then Tcl_Expr
40: returns \fBTCL_ERROR\fR and sets \fIinterp->result\fR to point
41: to an error message in the usual fashion.
42: \fBTcl_Expr\fR may make nested calls to \fBTcl_Eval\fR while parsing the
43: expression; if any of these calls returns an error then
44: \fBTcl_Expr\fR will return that same error information. If an error
45: is returned, then \fI*valuePtr\fR will not be modified.
46:
47: .SH KEYWORDS
48: evaluate, expression
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.