Native Inspect Manual (H06.04+)

Using Tcl Scripting
Native Inspect Manual528122-005
5-7
Tcl Commands Provided by Native Inspect
Tcl Commands Provided by Native Inspect
Native Inspect includes the built-in commands that are provided by open-source Tcl
(such as package provide and namespace eval). In addition to these, the commands
listed in Table 5-1 are provided specifically for the NonStop platform.
Table 5-1. Tcl Commands for NonStop Systems
Tcl Command Description
expr expression Evaluates a 32-bit expression.
format expression Outputs a formatted 32-bit expression.
lexpr expression Evaluates a long expression (both 64-bit arithmetic and
logical expressions). For expression, specify the high
and low 32 bits separated by a space.
mpexpr expression Evaluates a multiple precision expression.
Can have an arbitrary operand. There is no automatic
truncation, so be careful when performing bit-shifting
operations.
mpformat expression Outputs a formatted multiple-precision value.
Example:
tcl puts (mpformat 0x%x [mpexpr
0xffffffff00000000]] 0x0xffffffff00000000
{PUT | puts} expression Displays output; PUT does not include a newline, while
PUTS does. PUT output is also captured to a log file if
you use the Native Inspect log command to record a
debug session.
symexpr Passes the results of a symbolic expression to the Tcl
script. Typically used to assign a return value to a Tcl
variable. Is essentially the output of the Native Inspect
print command passed to the Tcl result buffer. The
result might be a single value or multiple values.
C++ Example:
(eInspect 3,301): tcl set x [symexpr
NUMCPLUS
(eInspect 3,301): tcl puts $x
15
COBOL Example:
(eInspect 5,1174): put [symexpr DI NOT
EQUAL 0
1
(eInspect 5,1174): tcl set x [symexpr DI
IS GREATER THAN 5]
(eInspect 5.1174): tcl puts $x
1]