<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>

  <TITLE>TK_EvalStr</TITLE>

  <TYPE>Scilab Function</TYPE>

  <DATE>22 October 2005</DATE>

  <SHORT_DESCRIPTION name="TCL_EvalStr">Evaluate a string whithin the tcl/tk
  interpreter</SHORT_DESCRIPTION>

  <SHORT_DESCRIPTION name="TK_EvalStr">Evaluate a string whithin the tcl/tk
  interpreter (obsolete)</SHORT_DESCRIPTION>

  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>TCL_EvalStr(str [,interp])</CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>

  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>str</PARAM_NAME>

        <PARAM_DESCRIPTION>
          <SP>: string or vector of strings, contains the tcl/tk
          instructions</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>

      <PARAM_ITEM>
        <PARAM_NAME>interp</PARAM_NAME>

        <PARAM_DESCRIPTION>
          <SP>: optional character string parameter. Name of the slave tcl
          interpreter in which the operation has to be performed. If not
          provided, it defaults to the main tcl interpreter created by
          Scilab.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>

  <DESCRIPTION>
    <P>This routine allows to evaluate tcl/tk instructions with the tcl/tk
    interpreter launched with Scilab (when the <VERB>interp</VERB> parameter
    is not given), or in a slave interpreter.</P>

    <P>When tcl/tk support is enabled in Scilab, you can evaluate tcl/tk
    expression from Scilab interpreter. In fact, Scilab launches a main tcl/tk
    interpreter. The Scilab instruction <VERB>TCL_EvalStr</VERB> can be used
    to evaluate expressions without having to write tcl/tk instructions in a
    separated file (this capability is provided by
    <VERB>TCL_EvalFile</VERB>).</P>
  </DESCRIPTION>

  <EXAMPLE><![CDATA[
//with one call
TCL_EvalStr(["toplevel .foo1"
   "label .foo1.l -text ""TK married Scilab !!!"""
   "pack .foo1.l"
   "button .foo1.b -text close -command {destroy .foo1}"
   "pack .foo1.b"])

//step by step (debugging)
TCL_EvalStr("toplevel .foo2");
// creates a toplevel TK window. 
TCL_EvalStr("label .foo2.l -text ""TK married Scilab !!!""");
// create a static label
TCL_EvalStr("pack .foo2.l");
// pack the label widget. It appears on the screen.
text="button .foo2.b -text close -command {destroy .foo2}";
TCL_EvalStr(text);
TCL_EvalStr("pack .foo2.b");

//kill the windows by program
TCL_EvalStr("destroy .foo1");
TCL_EvalStr("destroy .foo2");
 
//with one call, and in a slave interpreter
TCL_CreateSlave('TCLSlave');
TCL_EvalStr('set test ""in Slave TCL Interp""','TCLSlave');
TCL_GetVar('test','TCLSlave')

TCL_DeleteInterp('TCLSlave')
]]></EXAMPLE>

  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>ScilabEval</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>TCL_EvalFile</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>TCL_GetVar</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>TCL_SetVar</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>TCL_ExistVar</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>TCL_UnsetVar</LINK>
    </SEE_ALSO_ITEM>

    <SEE_ALSO_ITEM>
      <LINK>TCL_UpVar</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>

  <AUTHOR>Allan CORNET</AUTHOR>
</MAN>