HP 3000 Manuals

MOVE (Symbolic Debug) [ HPTOOLSET XL Reference Manual ] MPE/iX 5.0 Documentation


HPTOOLSET XL Reference Manual

MOVE (Symbolic Debug) 

Transfers the value of a literal, figurative constant, or data-item to
another data-item.

Syntax 

            {literal     }
     MOV[E] {data-item-1 } TO data-item-2 [|FOR| n |ITEMS| ]
            {fig-constant}

Parameters 

Literal (COBOL)           Is a character string that defines itself
                          rather than representing some other value.  The
                          value being transferred may be numeric or
                          non-numeric, signed or unsigned.  Non-numeric
                          values require surrounding double quotes.

                          This is a sending field.

Literal (Pascal)          May be a signed or unsigned numeric literal, a
                          non-numeric literal, or a simple constant
                          identifier.  Although double quotes are not
                          valid in standard Pascal, TOOLSET/XL allows
                          double quotes as well as single quotes.  If a
                          delimiter is a character in the literal, it
                          must appear twice.

Literal (FORTRAN)         May be a signed or unsigned numeric literal or
                          a character string enclosed in double quotes or
                          single quotes.

Data-item-1 (COBOL)       The sending field for the MOVE command.  A
                          data-item is any COBOL data-item or index-name
                          defined in your source program.  If
                          subscripted, the subscript must be an integer
                          value.  If the data-item is a table item and
                          unsubscripted, the subscript 1 is assumed.
                          Level 88 items are not allowed.

Data-item-1 (Pascal)      If data-item-1 is an array item with an actual
                          or assumed subscript (j), the subscript of
                          data-item-1 takes values (j) to (j+n-1)
                          inclusive when functioning as the source item
                          for the MOVE command.

                          If a subscript is used, it must be an integer,
                          character, or identifier that is part of an
                          enumerated type, depending on the type of the
                          array subscript.

Data-item-1 (FORTRAN)     The data-item can be any FORTRAN variable in
                          your source program.  Array items can be
                          referenced by using a subscript.

Figurative Constant       A value that has been assigned a fixed
(COBOL)                   data-name in COBOL. ZEROS and SPACES are the
                          only figurative constants allowed in
                          TOOLSET/XL.

Figurative Constants      Those standard constants recognized by the
(Pascal)                  Pascal compiler:  FALSE, TRUE, MININT, MAXINT,
                          and NIL.

Figurative Constants      The standard constants recognized by the
(FORTRAN)                 FORTRAN compiler:  .TRUE. and .FALSE..  Two
                          non-standard constants are recognized by the
                          symbolic debugger:  MININT and MAXINT. These
                          are a feature of TOOLSET/XL and not of the
                          FORTRAN language.

Data-item-2               The receiving field.

For n Items (COBOL)       Number of times data-item-1 is to be moved,
                          where n is a positive or unsigned integer.
                          This clause can be used if data-item-2 contains
                          an occurs clause in its Data Division
                          declaration.  A value of 1 is always assumed
                          for n if this is not specified.

                          The Lower Bound of a table is always assumed to
                          be one.  The Upper Bound is always assumed to
                          be the maximum value regardless of any possible
                          DEPENDING ON clause.

For n Items (Pascal and   This clause can be used only if Data-item-2 is
FORTRAN)                  of type ARRAY. If Data-item-2 is a one
                          dimensional array, a MOVE command will be
                          issued for the next n elements of the array,
                          starting with the actual or assumed subscript
                          specified in Data-item-2.

                          Specifying this parameter when Data-item-1 and
                          Data-item-2 are multi dimensional arrays and
                          subscripts are omitted causes rows or
                          sub-arrays to be moved.

Description 

COBOL 

The Symbolic Debug MOVE command allows you to transfer the value of a
literal, figurative constant or data-item to another data-item.  When the
sending field or literal is shorter than the receiving field, Data-item-2
is padded with zeros and spaces as required.  If data-item-2 is shorter,
the value is truncated.  The permissible types for data-item-1 and
data-item-2 and conversion are defined according to the COBOL MOVE
statement.

Subscripts

If data-item-2 is a table item with actual or assumed subscript (i), the
FOR n ITEMS clause has the same effect as issuing a MOVE command for each
item of the table with subscript (i) to (i+n-1) inclusive.

If, in addition, data-item-1 is a table item with actual or assumed
subscript (j), the subscript of data-item-1 takes the values (j) to
(j+n-1) inclusive when functioning as the source item for the MOVE
command.

Symbolic Debug aligns decimal points ("." ) in the sending and receiving
fields for you.

Pascal 

The MOVE command transfers the value of a literal, constant, or data-item
to another data-item.  Data-item-1 and Data-item-2 subscripts can be
integers, characters, or identifiers that are part of an enumerated type,
depending on the type of array subscript.

The following are rules for moving string literals or variables of type
STRING, packed array of char(PAC), or CHAR:

String Variable

If data-item-2 is a STRING variable, the sending field must be a STRING
variable or a STRING literal whose length is less than or equal to the
maximum length of data-item-2.  The sending field cannot be a PAC or CHAR
variable.  The MOVE command sets the current length of data-item-2.

PAC Variable

If data-item-2 is a PAC variable, the sending field must be a PAC of
equal length or a STRING literal whose length is less than or equal to
the length of data-item-2.  If the sending field is a STRING literal that
is shorter than data-item-2, then data-item-2 is padded with blanks.

CHAR Variable

If data-item-2 is a CHAR variable, the sending field can be a CHAR
variable, a STRING literal of length 1, or a subscripted string variable.

Example 

COBOL 

(1) Figurative Constant

     >>MOVE ZERO TO TABLE(5) FOR 20

Moves the value ZERO starting at element 5 of TABLE for 20 times.

(2) Data-item

     >>MOVE KOUNT TO TOT-KOUNT

Moves the value of data-item KOUNT to the data-item TOT-KOUNT

(3) Numeric Literal

     >>MOVE 25 TO KOUNT

Moves the value 25 to the data-item KOUNT which is defined as a picture
99.

(4) Table Item

     >>MOVE MY-TABLE TO THEIR-TABLE(2,4,3) FOR 5

Moves the items in MY-TABLE to THEIR-TABLE in the following manner:

     MY-TABLE        (1,1)     (1,2)     (1,3)     (2,1)     (2,2)

     THEIR-TABLE     (2,4,3)   (2,4,4)   (2,4,5)   (2,5,1)   (2,5,2)

MY-TABLE is defined as a (3*3) dimension table and THEIR-TABLE is defined
as a (5*5*5) dimension table.

Since MY-TABLE has no explicit subscript, it defaults to the first
element in the table.  The subscript that is nested the deepest varies
the fastest.

Pascal 

Moving Arrays

     (1)  >>MOVE AR1 TO AR2

Moves all elements of ARRAY AR1 to ARRAY AR2.

     (2)  >>MOVE AR1[1] TO AR2[5]

Moves row 1 of ARRAY AR1 to row 5 of ARRAY AR2.

Moving Data Items

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)  >>MOVE BLUE TO FIGURE.POLY-COLOR

          -->STMT #76:   Var  FIGURE.POLY-COLOR=BLUE

Moves the value Blue into the Record Polygon.

Moving Numeric Literals

Given the following:

     VAR Integer_Var:   INTEGER;
         Boolean_Var:   BOOLEAN;
         Char_Var:  CHAR;
         Real_Var:  REAL;
         Longreal_Var:  LONGREAL;

     (1)  >>MOVE 98.456601E-22 to Real_Var
          -->Stmt #104:  Var:  REAL_VAR = 9.8456601E-21

Moves the value 9.8456601E-21 to the data-item REAL_VAR.

Moving Characters and Literal Strings

Given the following:

     VAR Char_Var:    CHAR;
         Strl:  STRING[80];

     (1)  >>MOVE 'Z' TO CHAR_VAR
          -->Stmt #400:  Var:  CHAR_VAR  = 'Z'

Moves the character Z to the variable CHAR_VAR.

     (2)  >>MOVE "This is the good life."  TO STR1
          -->Stmt#401:  Var:  STR1 (22/80) = "This is the good life."

Moves the literal string above to the variable STR1 and sets the current
length of STR1 to 22 characters.


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 Moving Arrays: >>MOVE TABLE1 TO TABLE2 Moves all elements of ARRAY TABLE1 to ARRAY TABLE2. >>MOVE TABLE1[2] TO TABLE2[3] Moves column 2 of TABLE1 to column 3 of TABLE2. Moving Data Items: >>MOVE COUNT TO SAVE_COUNT Moving Literals: >>MOVE 25 TO COUNT Moves the value 25 into the variable COUNT. >>MOVE .TRUE. TO FILE_END Moves logical TRUE to the variable FILE_END. >>MOVE 'This is the good life' TO REPORT_LINE Moves the string literal into the variable REPORT_LINE. >>MOVE 6E23 TO CALC_VALUE Moves the number 6.0 * 10**23 to the variable CALC_VALUE. Moving to FORTRAN Variables: Given: INTEGER*4 LONG_INTEGER_VAR REAL*4 REAL_VAR1,REAL_VAR2 COMPLEX COMPLEX_VAR INTEGER*2 ARRAY_VAR1,ARRAY_VAR2 COMMON/COMMON_BLOCK/ARRAY_VAR1(4),ARRAY_VAR2(6),REAL_VAR2 Then: >>MOVE 125 TO LONG_INTEGER_VAR -->STMT#1: VAR:LONG_INTEGER_VAR=125 >>MOVE 3.14E38 TO REAL_VAR1 -->STMT#2: VAR:REAL_VAR=3.14E38 >>MOVE(9.2E10,1.2E5) TO COMPLEX_VAR -->STMT#3: VAR:COMPLEX_VAR=(9.2E10,1.2E55) >>MOVE (,2.34E5) TO COMPLEX_VAR -->STMT#3: VAR:COMPLEX_VAR=(9.2E10,2.34E5) >>MOVE (13.4E10,) TO COMPLEX_VAR -->STMT#3: VAR:COMPLEX_VAR=(13.4E10,2.34E5) >>MOVE 25 TO ARRAY_VAR1(1) FOR 3 ITEMS -->STMT#4: VAR:ARRAY_VAR[1] -->STARTING WITH ARRAY_VAR[1] 3 3 3 >>MOVE REAL_VAR1 TO REAL_VAR2 -->STMT#5: VAR:REAL_VAR2=3.14E38


MPE/iX 5.0 Documentation