Copying Program Segments; Moving Program Segments - HP 9000 200 Series Manual

Using the basic 5.0/5.1 system
Table of Contents

Advertisement

Copying Program Segments
While programming, you may encounter a need to duplicate several lines of BASIC
code in another location of the program. With this BASIC system, the COPYLINES
command provides an easy way of doing this kind of operation. Make sure the line to
which you copy is not an already existing line.
The first example belo,-{ copies lines 180 through 220 to a location beginning at line 5205:
COPYLINES 180,220 TO 5205
I
Return
I.
The following example copies lines 300 through 3005 to a location beginning at line 100:
COPYLINES 300,3005 TO 100
I
Return
I.
If the line you try to copy to already exists, an error occurs and no lines are copied. You
cannot copy to an already existing line.
Moving Program Segments
Earlier sections of this chapter showed how to use the
I
RECALL
1
key to recall a line which
was previously deleted. You could use this technique to move one or two lines from one
location in a program to another. However, when you are moving several program lines
at a time-to a spot several screens away from the original location-there is an easier
way: use the MOVELINES command. Make sure the line to which you move is not an
already existing line.
This example command moves lines 32 through 127, inclusive, to a spot beginning at
line 453:
MOVELINES 32,127 TO 453
I
Return
I.
The following example moves lines 300 through 3005 to a location beginning at line 100:
MOVELINES 300,3005 TO 100
I
Return
I.
If the line you try to move to already exists, an error occurs and no lines are moved. You
cannot move to an already existing line.
Editing and Storing Programs
6-25

Advertisement

Table of Contents
loading

This manual is also suitable for:

9000 300 series

Table of Contents