PRINT PSAM/DAPDB Commands PRINT
NAME
print - display the contents of variables
SYNOPSIS
print <variable-expression>( <subscripts> )
DESCRIPTION
The print command displays the contents of all variables in
the current procedure which match the expression <variable
expression>. If <subscripts> is specified only the indi-
cated elements are displayed. One or more expressions or
subscripted references, separated by spaces, are allowed in
a single invocation of the print command. No information is
given for arguments or local variables if the current pro-
cedure is not on the stack.
The expression <variable expression> may be the name of a
variable or may contain wild-card characters. Alphabetic
characters in <variable expression> are not case significant
and underscores are ignored.
The wild-card characters are as follows:
* - matches zero or more characters
? - matches any single character
[string] - matches any single character from string
[c1-c2] - matches any character in the alphabetic or
numeric range c1 to c2 inclusive.
In subscripted references to array variables one or more
subscripts can be used to define the range of data to be
displayed. The subscripts are separated by commas and each
subscript takes the following form:
<lowindex>:<highindex>
or
<index>
These indicate that only the elements between <lowindex> and
<highindex> or only the element <index> respectively should
be printed for the corresponding dimension of the variable.
<lowindex> and <highindex> may be omitted. Their default
values are the first and last elements in the given dimen-
sion respectively. If <index> is omitted all elements of
the corresponding dimension are displayed.
The form in which arrays are displayed depends on the values
AMT Release 4.1S Last change: 11th May 1989 1
PRINT PSAM/DAPDB Commands PRINT
of the environment variables Order, Pattern_mode,
Term_collection and Window_width. Order, if set, contains a
list of integers which specifies the order in which the
dimensions of an array are to be printed. Dimension number
1 is the fastest varying dimension in the array (the first
dimension in FORTRAN-PLUS). Pattern_mode is an integer in
the range 0 to 2 which controls the printing of logical and
character arrays. The value 0 causes such arrays to be
printed in the same way as all other arrays, comma separated
and with like terms being collected in any specified dimen-
sions. The values 1 or 2 cause logical and character arrays
to be printed as 1-dimensional or 2-dimensional patterns
respectively. Term_collection is an integer in the range 0
to 7 which specifies the number of consecutive dimensions in
the Order list in which like terms are collected.
Window_width is an integer in the range 45 to 132 which
defines the maximum number of characters on each printed
line.
Efficiency issues when displaying matrices
Notwithstanding the difference in speed between the DAP
hardware and simulator, the time taken by the print command
to display a matrix depends on two things - the size of the
matrix being displayed and the value of the Order environ-
ment variable.
The print command reads contiguous words from DAP array
store into a 256 kbyte cache. If the whole of the matrix
being displayed (or all elements when subscripting) fit into
this cache then printing is reasonably fast. However, in
this case, printing is fastest if the Order environment
variable has the value default or the value (2 1). If all
the data to be displayed cannot be fitted into the cache
then printing is slower. However, in this case, the best
printing speed is obtained by setting the value of Order to
(1).
EXAMPLES
print * prints all variables in current
procedure
print array prints all the values in the vari-
able ARRAY.
print [a-d]* prints all variables in current
procedure whose names begin with A,
B, C, or D.
print ??* prints all variables in the current
procedure whose names are at least
two characters long.
AMT Release 4.1S Last change: 11th May 1989 2
PRINT PSAM/DAPDB Commands PRINT
print vec1(7) prints the seventh element of VEC1.
print vec1(16:24) prints elements 16 to 24 inclusive
of the variable VEC1.
print vec1(8:) prints elements 8 to the last ele-
ment inclusive of the variable
VEC1.
SEE ALSO
display, set
AMT Release 4.1S Last change: 11th May 1989 3