SYNOPSIS
#include <tcl.h>
int Tcl_ExprLongObj(interp, objPtr, longPtr)
int Tcl_ExprDoubleObj(interp, objPtr, doublePtr)
int Tcl_ExprBooleanObj(interp, objPtr, booleanPtr)
int Tcl_ExprObj(interp, objPtr, resultPtrPtr)
ARGUMENTS
- Tcl_Interp *interp (in)
-
Interpreter in whose context to evaluate string or objPtr.
- Tcl_Obj *objPtr (in)
-
Pointer to an object containing the expression to evaluate.
- long *longPtr (out)
-
Pointer to location in which to store the integer value of the expression.
- int *doublePtr (out)
-
Pointer to location in which to store the floating-point value of the expression.
- int *booleanPtr (out)
-
Pointer to location in which to store the 0/1 boolean value of the expression.
- Tcl_Obj *resultPtrPtr (out)
-
Pointer to location in which to store a pointer to the object that is the result of the expression.
DESCRIPTION
These four procedures all evaluate an expression, returning the result in one of four different forms. The expression is given by the objPtr argument, and it can have any of the forms accepted by the expr command.
The interp argument refers to an interpreter used to evaluate the expression (for example, for variables and nested Tcl commands) and to return error information.
For all of these procedures the return value is a standard
Tcl result: TCL_OK means the expression was successfully
evaluated, and TCL_ERROR means that an error occurred while
evaluating the expression.
If TCL_ERROR is returned,
then a message describing the error
can be retrieved using
If the expression is successfully evaluated, then its value is
returned in one of four forms, depending on which procedure
is invoked.
If
PORTABILITY
Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022. Windows Server 2025.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
Tcl_ExprBoolean() ,Tcl_ExprDouble() ,Tcl_ExprLong() ,Tcl_ExprString() ,Tcl_GetObjResult()
PTC MKS Toolkit 10.5 Documentation Build 40.