Show Variable Command

This command displays variable values during debugging.

Show Variable [-eval] thread_name frame_number variable

Prerequisites

The thread must have been started with a Start command, but it must currently be in Idle, Paused, or Error state. It cannot be active when this command is issued.

Parameters

-eval

An optional switch that specifies that the variable parameter should be evaluated even if it is a Sub procedure that does not return any value, such as the Location.Here method. Normally attempting to show such a procedure value is considered an error.

thread_name

The thread executing the procedure that references the variable to display.

frame_number

The number of the stack frame that determines the context for the variable value. Only variables accessible to the procedure using this stack frame may be displayed. 0 corresponds to the top of the stack, and numbers greater than 0 are deeper frames in the stack.

variable

A variable, function call, object, object method or get property.

Remarks

For simple numeric variables, this command displays:

variable, type, value

where:

variable

Is the variable field entered in the command.

type

Is the variable type name, for example Integer or Double.

value

Is the numeric value.

For array variables, this command displays:

variable, type(…), value

where:

variable

Is the variable field entered in the command.

type

Is the variable type name, for example Integer or Double.

(…)

Indicates the variable is an array. The number of commas within the ( ) is one less than the rank of the array, so ( ) indicates 1 dimension, (,) indicates 2 dimensions, etc.

value

Is the array element value. This field is only shown if a single array element is specified by filling in the index values in the variable field. The values of whole arrays are not displayed.

For object variables, this command displays multiple lines. One for the main object, and one for each field or no-argument Get Property. If a Get Property requires arguments, it is not displayed.

variable, Object
variable.field, type, value
variable.property, type, value

where:

variable

Is the variable field entered in the command.

type

Is the field or property type name, e.g. Integer or Double.

value

Is the field or property value, if numeric.

For object variables, the values of referenced objects are not shown, but these values may be shown with a separate Show Variable command of the form:

Show Variable thread_name frame_number Object1.Object2

The stack frame determines the context for finding the variable value. See the ShowStack command for additional information on stack frames. Use that command to determine the frame of interest.

If a function or get property value needs to be determined, that procedure is executed in the proper frame context but by the console thread rather than its normal thread. This difference may cause unexpected values to be returned if the procedure is thread-dependent, for example when displaying a robot attachment property.

Examples

Show Variable Test 0 ii
ii, Integer, 5


Show Variable Test 2 My_array
My_array, Double(,)


Show Variable Test 2 My_array(0,0)
My_array(0,0), Double(,), 30.5


Show Variable Test 0 Loc

Loc, Object

Loc.Config, Integer, 0

Loc.Pitch, Double, 180

Loc.Pos, Object

Loc.PosWrtRef, Object

Loc.RefFrame, Object

Loc.Roll, Double, 180

Loc.Type, Byte, 0

Loc.X, Double, 0

Loc.Y, Double, 0

Loc.Yaw, Double, 0

Loc.Z, Double, 0

Loc.ZClearance, Double, 1E+32

Loc.ZWorld, Boolean, 0

See Also

Console Commands | Show Thread Command