Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The thing to remember about Expect is that it's really just an extension to Tcl, so if you are looking for help on writing Expect scripts and your question is not related to one of the Expect specific commands, you should try looking in the Tcl references. A good starting place is <a href="http://www.tcl.tk" rel="nofollow noreferrer">http://www.tcl.tk</a>, as well as <a href="http://wiki.tcl.tk" rel="nofollow noreferrer">http://wiki.tcl.tk</a>.</p> <p>There are two ways to do what you're trying to do: <code>incr</code> and <code>expr</code>. <code>incr</code> may be used when you are adding an integer value to another integer. It is very fast for that operation. For example:</p> <pre><code>set value 1 incr value </code></pre> <p>However, <code>incr</code> does not work with non-integer values, and it can't do anything but addition (or subtraction if you negate the increment, as in <code>incr value -1</code>). If you need something more elaborate, you should use <code>expr</code>:</p> <pre><code>set value 1 set value [expr {$value + 1}] </code></pre> <p>Note the use of curly braces around the expression! Although they are not required for correct operation in general, they improve performance. If you are doing many arithmetic operations, using braces around the expressions will significantly improve the performance of your script. For more information, see <a href="http://wiki.tcl.tk/10225" rel="nofollow noreferrer">http://wiki.tcl.tk/10225</a>. You should get in the habit of <em>always</em> bracing your expressions when using <code>expr</code>.</p> <p>You can find links to several Expect resources at <a href="http://wiki.tcl.tk/201" rel="nofollow noreferrer">http://wiki.tcl.tk/201</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload