HP 3000 Manuals

MOVE [ HP RPG/XL Utilities-Part 2 RISE ] MPE/iX 5.0 Documentation


HP RPG/XL Utilities-Part 2 RISE

MOVE 

MOVE transfers lines to a new location.

Form 

          MOV[E] lb[/le] TO loc [BY inc]

Parameter Explanation 

lb               Single line you wish to move or the beginning of a range
                 of lines you are moving.

le               Last line of range you wish to move.

TO loc           Location where the lines are to appear.  If destination
                 line exists, the lines will be moved starting at the
                 next line in sequence.

BY inc           Increment of line numbers you wish to use.  If "BY inc"
                 isn't specified, the current default increment is used.
                 If you attempt to move too many lines into a restricted
                 position, the move may be blocked by the next higher
                 line number.  When this occurs, none of the lines are
                 moved.

Purpose 

The MOVE command transfers a line or lines to a designated location.

Related Commands 

The COPY command duplicates a line or lines in a new position while
leaving the original lines where they are.  The MOVE command does not
leave lines in their original position; they are physically transferred.

 *  Execution mode:  Line or Block.

 *  Record pointer:  At the line following the last line that was moved.

 *  Control Y: Stops the listing of lines being moved.

Examples 

The following are legal abbreviations which may be used with the MOVE
command and its parameters:

MOV 10 TO 20     Move line 10 to line 20.  (If data has been entered on
                 line 20, RISE will move 10 to the next higher line by
                 automatically creating an increment such as 20.1 if that
                 is possible.)

MOV *-5/*+5 to   Move a range of lines beginning 5 lines before the
*+20             current record pointer to a position 20 lines after the
                 current record pointer.

MOV F TO LAST    Move the first line to the last line in the file.

In the first example, SIMCAL is copied into a work file using the TEXT
command, and five lines are brought to the screen using LIST (1).  The
MOVE command is then used to move line 2 to line 3.5 (2).  The results
are automatically displayed (3).  Lines 1 through 5 are then LISTed (4).

          >T SIMCAL
           Text completed.
     (1)  >L 1/5
              1     00011H
              SIMCAL
              2     00012FINPUT    IP  F       72               DISK
              3     00013FOUTPUT   O   F       72               DISK
              4     00014IINPUT    AA  01   1  CA
              5     00015I        OR   02   1  CS

     (2)  >MOVE 2 TO 3.5
              3.5  00012FINPUT     IP  F       72               DISK

     (3)   Move completed.

     (4)  >L1/5
              1     00011H
              SIMCAL
              2     00013FOUTPUT   O   F       72               DISK
              3.5   00012FINPUT    IP  F       72               DISK
              4     00014IINPUT    AA  01   1  CA
              5     00015I        OR   02   1  CS

In the next example, the record pointer is moved to the last line in the
file when LIST LAST is entered (1).  A command is then given to MOVE a
range of lines beginning ten lines before the current record pointer and
ending with the last line in the file to line 100 (2).  The results
appear on the screen (3).  An attempt to move an empty line range brings
up an error message (4).  Another error is committed when a MOVE command
is entered with only a portion of the line range specified (5).  Finally,
a third error is caused by a MOVE command used with an illegal
destination value (6).

     (1) >L LAST
            38     00048O*END OF POGRAM

     (2) >MOVE *-10/LAST TO 100
           100     00038O                     RESULT  60 "   , 0 .    -"
           101     00039O    D 1        1P
           102     00040O   OR         N1P
           103     00041O                             10 "ENTER DATA"
           104     00042O                             25 "IN THE FORMAT:"
           105     00043O    D 11       1P
           106     00044O   OR         N1P
           107     00045O                             13 "C NNNDD NNNDD"
           108     00046O    D          05
           109     00047O                             15 "INVALID REQUEST"

     (3)   110     00048O*END OF PROGRAM
          Move completed.

     (4) >MOVE 50/70 TO FIRST BY .11
          Error 81: Range is empty.

     (5) >MOVE FIRST
          Error 149: TO location missing.

     (6) >MOVE FIRST TO .1155
                             ^
          Error 74: A maximum of 3 digits is allowed right of decimal.
         >



MPE/iX 5.0 Documentation