HP 3000 Manuals

DISPLAY [ HPTOOLSET XL Reference Manual ] MPE/iX 5.0 Documentation


HPTOOLSET XL Reference Manual

DISPLAY 

Is a Symbolic Debug command that causes the current contents of specified
data-items to be displayed on your terminal.

Syntax 

                                            [ O[CTAL]      ]
               {rec-item [USING t1[,t2]...]}[ I[NTEGER]    ][|FOR| n |ITEMS|]
     DI[SPLAY] { data-item                 }[ C[HARACTER]  ]
               {"literal"                  }[ H[EXADECIMAL]]

Parameters 

Data-item        Any COBOL data name or index name defined in the COBOL
(COBOL)          source program.  A data-item may be qualified with:
                   (1) OF,
                   (2) IN,
                   (3) subscript (must be an integer value), or
                   (4) periods separating the data names, where the most
                   significant data name is specified first.

                 If data-item is subscripted, the subscript must be an
                 integer value and not a variable.  If no subscript has
                 been used, a subscript of 1 will be assumed.

                 You cannot reference a data-item in a program or
                 subprogram other than the one that is currently
                 executing.

Data-item        Any Pascal variable declared in the source program.
(Pascal)         Standard Pascal selectors are used to qualify arrays and
                 records.

Data-item        Any FORTRAN data name defined in the source program.
(FORTRAN)        Standard FORTRAN delimiters are used in referencing
                 array elements.

                 To reference a variable outside the currently running
                 program or subprogram, the variable must be in a common
                 block.

Literal          Displays the delimited string.  Although double quotes
                 are not valid in standard Pascal, double quotes and
                 single quotes are allowed as delimiters.

                 If a delimiter is a character in the literal, it must
                 appear twice consecutively.

OCTAL INTEGER    These keyword options override the implied format of the
CHARACTER        specified data-item.  If the CHARACTER option is used,
HEXADECIMAL      the contents of the entire item are displayed as a
                 continuous string of USASCII characters.  Non-printing
                 characters are replaced by a period.

Rec-item         A data-item of Record type.

USING            Pascal Only
t1[,t2]...
                 Used when you want to display a specific variant part of
                 a rec-item.  t1...tn represent tag field constants that
                 you may specify to explicitly select different variant
                 parts of a record in the display.

                 If no tag field constant is specified in the DISPLAY
                 command for discriminated union records, the default is
                 to use the actual tag field data-item to select the
                 variant part.  This default can be overridden by using
                 the tag field options constant of this command.

                 If no tag field constant has been explicitly specified
                 for free union records, the first variant of the record
                 will be displayed by default.

FOR n ITEMS      Is used to display a specified number of table elements.
(COBOL)          This clause can only be used if the data item contains
                 an OCCURS clause in its DATA DIVISION declaration.  n is
                 assigned the value of 1 if this clause is not specified.

FOR n ITEMS      Is used to display a specified number of characters in a
(Pascal)         STRING or a specified number of elements in an ARRAY.
                 When this clause is specified for a string, the string
                 must be subscripted.  n characters of the string will be
                 displayed beginning with the character indicated by the
                 subscript.

FOR n ITEMS      Is used to display a specified number of elements in an
(FORTRAN)        array.

Description 

The DISPLAY command displays the current contents of data-items you
specify on your terminal according to formats implied by the type
descriptions in the Data Division of your source file (COBOL) or
according to the formats implied in the declarations of your source file
(Pascal or FORTRAN).

COBOL 

Data Division Formats

(1)              Data with PICTURE X or A is output as USASCII
                 characters.

(2)              Picture 9 data is output in a format consistent with the
                 COBOL Display statement.

(3)              Computational-3 packed data is output as decimal digits.
                 The sign bits are interpreted and output before the
                 number.  Leading zeros are displayed.

(4)              Computational binary data is output as decimal integers.
                 Negative signs are output preceding the number.

Table Items

If the data-item is a table item with an actual or assumed subscript (i),
the [FOR n ITEMS] clause has the effect of issuing a DISPLAY command for
each item in the table with subscript (i) to (i+n-1) inclusive.

Group Items

The default format for a group item is to display the entire item in
character format.

Pascal 

The DISPLAY command displays the current contents of specified data-items
according to the formats implied in the source program's type
declarations.  Only those data-items that are active at the current
breakpoint may be displayed.

Strings

The default display of variables with a structure type STRING is
CHARACTER format.  The first and last characters of the string are
indicated by enclosing them in quotes.  The current and maximum lengths
of the string are also shown.

Record

The default display of data-items of Record type is based on its
declaration in the source.  This means that each field of the record is
treated as its own separate data-item with its own separate default
display type.  You have the option of displaying the record in OCTAL,
INTEGER, CHARACTER, or HEXADECIMAL. In these cases, the data is displayed
contiguously.

If you qualify the record with a particular field, such as MyRec.Field1,
only that field will be displayed in its declared type, unless it is
overridden by the OCTAL, INTEGER, CHARACTER or HEXADECIMAL option.

If the record is a union type, the fixed and a variant part of the record
will be displayed.

Pointer

The default display of Pointer type variables is the HEX address in the
pointer or NIL.

Enumerated

Variables of enumerated type are displayed using the values associated
with that enumerated type.

Set

Data-items of the structured type SET are displayed as members of the
base type of that SET.

Boolean, Real, or Longreal

The default display for BOOLEAN type variables is TRUE or FALSE. The
default display for variables of REAL type is real.  The default display
for variables of LONGREAL type is longreal.

Function or Procedure

Functions or procedures that are parameters to procedures are displayed
with the name of the procedure they are parameters to along with the
external program label as it appears in the Segment Transfer Table.

Character, Integer, and User-Defined

Displays of variables that are of CHARACTER or INTEGER type are displayed
in the corresponding default format, as are user defined variables of
CHARACTER or INTEGER base type.

Constants

The display of symbols that are simple CONSTANTS contains the value and
the source statement where it is declared.  If the symbol is a structured
Constant, including Arrays, Strings, Records and Set Constants, only the
source statement will be displayed.

Withs

If execution has been suspended inside of a with construct, then fields
inside the with referenced record may be displayed by simply specifying
the field names.

Using Clause

When displaying a record with fields that are records, and both contain
variant parts, the USING clause parameters are used to select which
variant of each record to display.  Consider the following code and
examples:

     TYPE Case1 = (V1,V2,V3);
          Case2 = (V21,V22,V23);

     VAR Rec : RECORD
                  F1 :    RECORD
                            F1:   INTEGER;
                            F2:   INTEGER;
                            CASE CASE1 OF
                              V1:  (F21 : INTEGER);          {(1)}
                              V2:  (F22 : CHAR);             {(2)}
                              V3:  (F23 : RECORD             {(3)}
                                            F1 : BOOLEAN;
                                            F2 : REAL;
                                            CASE CASE2 OF
                                              V21 : (F21: INTEGER);
                                              V22 : (F22: BOOLEAN); {(3)}
                                              V23 : (F23: REAL);
                                          END;

                          END;
                  F2: CHAR;
                  CASE CASE1 OF
                    V1 : (F21: REAL);    {(1) BY DEFAULT}
                    V2 : (F22: INTEGER); {(2)}
                    V3 : (F23: BOOLEAN); {(3)}
                END;


NOTE One cannot DISPLAY, MOVE, or DATATRACE Pascal local variables or parameters that reference global types that have not been included in the main outer block compile. In other words, variables or parameters that reference newly added global types in their subprogram compile. This may be a problem with mixed languages.
FORTRAN Default Display Data Types Character Character data types are displayed as USASCII characters. Integer, Short Integer Integer and short integer are displayed as decimal numbers. Real, Double Precision Real and double precision will be displayed as real or double precision real numbers. Logical The default display for Logical type variables is .TRUE. or .FALSE. Complex, Double Complex Display will be with the Real or Double Precision number first followed by the imaginary number (e.g., (3.4E38,1.2E10)). Array The data will be displayed with the type the array name was declared as. FORTRAN arrays are row-major; a DISPLAY will increment through the row index before incrementing the column index. Function, Subprogram Functions and subroutines that are parameters to subroutines are displayed with the name of the procedure they are parameters to, along with the external procedure or subroutine label. Constants (Parameter) Constants defined with the PARAMETER statement will be displayed exactly as the constant was defined in the source program. Example The following DISPLAY commands illustrate the sequence that TOOLSET/XL uses when displaying variants within nested records. The variant displayed by each DISPLAY command is labeled with the number of that example in the sample code above. (1) DISPLAY REC USING V1 Displays the variant V1 located in the nested record F1 and, by default, the variant V1 in the outer record REC. -->Stmt #4 Var: REC Record F1 - Record F1 = 10 F2 = 20 F21 = 30 F2 = 'a' F21 = 1.034000E+2 (2) DISPLAY REC USING V2, V2 Displays the variant V2 located in the nested record F1 and the variant V2 located in the outer record REC. -->Stmt #4 Var: REC - Record F1 - Record F1 = 10 F2 = 20 F22 = 'z' F2 = 'a' F22 = 30 (3) DISPLAY REC USING V3, V22, V3 Displays the variant V3 located in the nested record F1. Since the variant V3 is of record type with its own variant, this command also displays the variant V22 located in the record F23 nested 2 deep inside REC. Lastly, this command displays the variant V3 located in the outer record REC. -->Stmt #4 Var: REC - Record F1 - Record F1 = 10 F2 = 20 F23 - Record. F1 = TRUE F2 = -3.4577008E+2 F22 = FALSE F2 = 'A' F23 = TRUE The fixed fields for all of these records are also displayed.
[]
Figure 4-5. Display Command Screen (COBOL) Pascal Given the following: VAR Integer_Var: INTEGER; Boolean_Var: BOOLEAN; Char_Var: CHAR; Real_Var: REAL; Longreal_Var: LONGREAL; (1) >>DISPLAY Integer_Var -->Stmt #101: Var: INTEGER_VAR = 1234 Displays the value of INTEGER_VAR. (2) >>DISPLAY Boolean_Var -->Stmt #102: Var: BOOLEAN_VAR = TRUE Displays the value of BOOLEAN_VAR. Given the following: TYPE Polys = (circle, square, rectangle, triangle); Polygon = RECORD (*fixed part and tagless variant part*) Poly_Color: (red, yellow, blue); CASE Polys OF circle: (Radius: INTEGER); square: (Side: INTEGER); rectangle: (Length, Width: INTEGER); triangle: (Base, Height: INTEGER); END; VAR Figure: Polygon; (1) >>DISPLAY Figure -->Stmt #76: Var: FIGURE - Record POLY_COLOR = RED RADIUS = 42 (2) >>DISPLAY Figure Using Rectangle -->Stmt #75: Var: FIGURE - Record POLY_COLOR =RED LENGTH = 42 WIDTH = 21 Given the following: TYPE Fruit = SET OF (apple, banana, cherry, peach, pear, pineapple); VAR Fruits : Fruit; (1) >>DISPLAY FRUITS -->Stmt #34: Var: FRUITS = [APPLE, BANANA, PEAR] FORTRAN Data Types Given INTEGER*4 LONG_INTEGER_VAR INTEGER*2 SHORT_INTEGER_VAR REAL*4 REAL_VAR DOUBLE PRECISION DOUBLE_PREC_VAR (or REAL*8) COMPLEX COMPLEX_VAR (or COMPLEX*8) DOUBLE COMPLEX DOUBLE_COMPLEX_VAR (or COMPLEX*16) LOGICAL*4 LONG_LOGICAL_VAR LOGICAL*2 SHORT_LOGICAL_VAR then >>DISPLAY LONG_INTEGER_VAR --> Stmt #101: Var: LONG_INTEGER_VAR = 1234567890 >>DISPLAY SHORT_INTEGER_VAR --> Stmt #102: Var: SHORT_INTEGER_VAR = 32767 >>DISPLAY REAL_VAR --> Stmt #103: Var: REAL_VAR = 3.402823E38 >>DISPLAY DOUBLE_PREC_VAR --> Stmt #104: Var: DOUBLE_PREC_VAR = 1.79769313486231E308 >>DISPLAY COMPLEX_VAR --> Stmt #105: Var: COMPLEX_VAR = (3.4E38,1.2E10) >>DISPLAY DOUBLE_COMPLEX_VAR --> Stmt #106: Var DOUBLE_COMPLEX_VAR = (1.8E308,3.8E308) >>DISPLAY LONG_LOGICAL_VAR --> Stmt #107: Va:r LONG_LOGICL_VAR = .TRUE. >>DISPLAY SHORT_LOGICAL_VAR --> Stmt #108: Var: SHORT_LOGICAL_VAR = .FALSE. Array Types Given INTEGER*4 ARRAY_VAR(2:5,1:3) (note that this is equivalent to: INTEGER*4 ARRAY_VAR DIMENSION ARRAY_VAR(2:5,1:3) ) then >>DISPLAY ARRAY_VAR --> Stmt #101: Var ARRAY_VAR --> Starting with ARRAY_VAR[2,1]. 1234 4566 12345678 9876 --> Continuing with ARRAY_VAR[2,2] 23456 121 357951 0 --> Continuing with ARRAY_VAR[2,3] 654 1 963 5 >>DISPLAY ARRAY_VAR[4,1]FOR 3 ITEMS --> Stmt #101: Var ARRAY_VAR --> Starting with ARRAY_VAR[4,1]. 12345678 9876 --> Continuing with ARRAY_VAR[2,2] 23456 >>DISPLAY ARRAY_VAR[5,3] --> Stmt #101: Var ARRAY_VAR[5,3] = 5 Character and Character Array Variables Given: CHARACTER*8 CHAR_VAR CHARACTER*8 ARRAY_CHAR_VAR DIMENSION ARRAY_CHAR_VAR(4,4,4) and if the value of CHAR_VAR is 'abcdefgh', then >>DISPLAY CHAR_VAR --> Stmt #101:Var CHAR_VAR = 'abcdefgh' >>DISPLAY CHAR_VAR(1) FOR 3 ITEMS --> Stmt #101:Var CHAR_VAR = 'abc' If the value of ARRAY_CHAR_VAR(1,1,2) is 'ijklmnop', then >>DISPLAY ARRAY_CHAR_VAR(1,1,2) --> Stmt #101: Var ARRAY_CHAR_VAR = 'ijklmnop' >>DISPLAY ARRAY_CHAR_VAR(1,1,2)(5) FOR 4 ITEMS --> Stmt #101:Var ARRAY_CHAR_VAR = 'mnop' >>DISPLAY ARRAY_CHAR_VAR(3,4,1) FOR 5 ITEMS --> Stmt #101: Var ARRAY_CHAR_VAR --> Starting with ARRAY_CHAR_VAR(1,1,1) ARRAY_CHAR_VAR[3,4,1] ARRAY_CHAR_VAR[4,4,1] ARRAY_CHAR_VAR[1,1,2]='ijklmnop' ARRAY_CHAR_VAR[2,1,2] ARRAY_CHAR_VAR[3,1,2] Common Blocks Given: INTEGER*2 I,J COMMON /BLOCKA/I(4),J(6),ALPHA,SAM CHARACTER*4 ALPHA then >>DISPLAY BLOCKA --> Stmt #101: COMMON BLOCK:BLOCKA I - ARRAY --> Starting with I(1) 0 1234 45 3 J - ARRAY --> Starting with J(1) 1 23 45 67 87 5 ALPHA = 'abcd' SAM = 90.00


MPE/iX 5.0 Documentation