- CLASS
- tcl.lang.Interp -- This manual entry contains Interp methods that manipulate
the result object.
- METHODS
- TclObject getResult()
- void setResult(TclObject tobj)
- void setResult(String str)
- void setResult(int i)
- void setResult(double d)
- void setResult(boolean b)
- void resetResult()
- OTHER METHODS
- ARGUMENTS
- DESCRIPTION
- setResult
- getResult
- resetResult
- EQUIVALENT C FUNCTIONS
- SEE ALSO
- KEYWORDS
tcl.lang.Interp -- This manual entry contains Interp methods that manipulate
the result object.
TclObject getResult()
void setResult(TclObject tobj)
void setResult(String str)
void setResult(int i)
void setResult(double d)
void setResult(boolean b)
void resetResult()
setVar,
traceVar,
createCommand,
eval,
backgroundError,
getNotifier,
setAssocData,
dispose,
pkgRequire
- TclObject tobj ()
-
TclObject value to become result for Interp.
- String str ()
-
String value to become result for Interp.
- int i ()
-
Primitive int value to become result for Interp.
- double d ()
-
Primitive double value to become result for Interp.
- boolean b ()
-
Primitive boolean value to become result for Interp.
The procedures described here are utilities for manipulating the
result value in a Tcl interpreter. The interpreter result is stored
as a TclObject but may be set as a TclObject, String, int, double or
float. See the manual entry backgroundError for information on
processing errors.
- setResult
-
The setResult method arranges for the argument to be the result
for interp, replacing any existing result.
The result is left pointing to a TclObject that was converted from one
of the five possible argument types. The TclObjects's reference count
is incremented since there is now a new reference to it from Interp.
The reference count for any old result object
is decremented and the old result object is freed if no
references to it remain.
- getResult
-
the getResult method returns the result for Tnterp as a TclObject.
The object's reference count is not incremented;
if the caller needs to retain a long-term handle to the object
they should use preserve method of the TclObject to increment
its reference count in order to keep it from being garbage collected
too early or accidently changed.
- resetResult
-
The resetResult method clears the result for Interp
and leaves the result in its normal empty initialized state.
The result's reference count is decremented and the result is left
pointing to an unshared object representing an empty string.
Calls to resetResult also clear the error state managed by
addErrorInfo, and setErrorCode.
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_ResetResult
Interp, setVar, Eval, backgroundError
append, command, element, interpreter, list, object, result, return value
Copyright © 1994-1998 Sun Microsystems, Inc.
Copyright © 1995-1997 Roger E. Critchlow Jr.