  CLASS
    tcl.lang.Interp -- This manual entry contains Interp methods that execute or check Tcl scripts.
  METHODS
    void eval(String str) throws TclException
    void eval(String str, int flags) throws TclException
    void eval(TclObject tobj, int flags) throws TclException
    void evalFile(String fileName) throws TclException
    static boolean commandComplete(String cmdName) throws TclException
  OTHER METHODS
  ARGUMENTS
  DESCRIPTION
    eval
    evalFile
    commandComplete
  EQUIVALENT C FUNCTIONS
  SEE ALSO
  KEYWORDS

### CLASS

tcl.lang.Interp -- This manual entry contains Interp methods that execute or check Tcl scripts.

### METHODS

void eval(String str) throws TclException

void eval(String str, int flags) throws TclException

void eval(TclObject tobj, int flags) throws TclException

void evalFile(String fileName) throws TclException

static boolean commandComplete(String cmdName) throws TclException

### OTHER METHODS

setVar, traceVar, createCommand, setResult, backgroundError,
getNotifier, setAssocData, dispose, pkgRequire

### ARGUMENTS

String str ()
  String value of script to evaluate.

TclObject tobj ()
  TclObject value of script to evaluate.

int flags ()
  OR-ed combination of flag bits that specify additional options. TCL_EVAL_GLOBAL and TCL_EVAL_DIRECT are currently supported. These flags control the stack level of the evaluation.

String fileName ()
  File containing script to evaluate.

String cmdName ()
  Command string to test for completeness.

### DESCRIPTION

The methods described here are invoked to execute Tcl scripts in various forms.

eval
  The eval method executes the commands in the script stored in str or tobj until either an error occurs or the end of the script is reached. If the flag argument is specified, it controls the stack level of the evaluation via an OR-ed combination of flag bits. Currently, only the TCL_EVAL_GLOBAL flag is supported. If this flag is set, the script is processed at global level. This means that it is evaluated in the global namespace and its variable context consists of global variables only (it ignores any Tcl procedures that are active). Otherwise, the script is evaluated in the current stack level. A TclException is thrown if an error occurs in evaluating the str or tobj (e.g. the script contains bad Tcl syntax or accesses an undefined variable).

evalFile
  The evalFile method reads the file given by fileName and evaluates its contents as a Tcl script. It behaves the same as eval.

commandComplete
  The commandComplete method takes a Tcl command str as argument and determines whether it contains one or more complete commands (i.e. there are no unclosed quotes, braces, brackets, or variable references). If the command string is complete then it returns true; otherwise it returns false.

### EQUIVALENT C FUNCTIONS

Tcl_Eval, Tcl_GlobalEval, Tcl_EvalObj, Tcl_EvalFile, Tcl_CommandComplete

### SEE ALSO

Interp, setVar, setResult, addErrorInfo, dispose, TclException, TclRuntimeError, TclEvent

### KEYWORDS

complete command, execute, file, global, interpreter, object, partial command, result, script

    Copyright © 1994-1998 Sun Microsystems, Inc.
    Copyright © 1995-1997 Roger E. Critchlow Jr.