Copies program lines from one location to another.
COPYLINES start [,end] TO target
Usage:
COPYLINES 10,100 TO 500
COPYLINES 1500 TO 2222
COPYLINES ALabel,BLabel TO Clabel
Description:
Note: COPYLINES is supported for HP BASIC compatibility as HP Workstations did not have full-screen editors which made this type of editing command necessary. But it is now much easier to use copy and paste with HTBasic's full-screen editor.
Use COPYLINES to copy a block of lines to a new location, while leaving the original lines untouched. This differs from the MOVELINES statement since the MOVELINES statement deletes the original program portion. If no ending line is specified, only one line is copied. The target line cannot be in the range specified by start and end. If start doesn't exist, the line immediately after that line number is used. If end doesn't exist, the line immediately before that line number is used. If a non-existent line label is specified, an error will be reported.
Line numbers and labels are renumbered and updated if needed. However, line number references in lines not being copied remain linked to the original lines rather than the newly created lines. COPYLINES may not copy lines containing a SUB program or DEF FN definition unless the new line number is greater than any existing line number. An error will be issued if this is not the case. This is because a SUB or DEF FN must follow all previous lines. If an error occurs during a COPYLINES, the copy is terminated and the program is left partially changed.
This command can only be executed from the keyboard while no program is running. It cannot be included in a program.