Customer Service Center
Spirent KB Article
Doc ID: FAQ13880
Email Article Link
What about the iTest interpreter and the Tcl interpreter?
Actions that operate in the iTest environment: eval, set, get.
The iTest interpreter performs tasks that are useful in the iTest environment. We designed the syntax to be very much like Tcl so that the commands would be easier to understand. You can use iTest interpreter commands to perform a variety of tasks; some commands set a variable value (set), get a variable value (get), perform mathematical operations (math.abs), return information about iTest (info), or access the response to an earlier step (response).
Some iTest interpreter commands have Tcl counterparts and some do not. For example, you can use set i 0 (which uses the same syntax as Tcl) to assign the value 0 to the variable i. You can then use i as a local variable in your test case with the value $i.
You can use the iTest eval action to evaluate the iTest commands (actually, statements) that are specified in the Description cell.
Using special iTest actions to access the Tcl environment: scriptEval, scriptSet, and scriptGet.
The scriptEval action uses the Tcl interpreter. If you perform set i 0, then variable i is set only in the Tcl environment — the iTest environment does not know about the variable.
: Even though the variable that we just set is named i, it is a variable in the Tcl environment—a completely different and independent variable from the variable i that we earlier set in the iTest environment.
You can continue to use scriptEval to, for example, source your own Tcl script that makes use of $i. The benefit of having scriptEval is that it supports all Tcl operations.
To pass variables back and forth between the iTest interpreter and the Tcl interpreter, use scriptSet and scriptGet.
You can think of it as the “iTest world” and “Tcl world”:
When you use the scriptEval action, you are operating in the Tcl world.
When you use the eval action, you are operating in the iTest world.
You use the scriptSet and scriptGet actions to peek and poke variables between the Tcl world and the iTest world.
Product : iTest Enterprise