MERGE

BASin

MERGE

Statement/Command

MERGE allows two programs to be merged together.

How to use MERGE

MERGE may be used to form a statement in a program or more commonly as a direct command. It is followed by a filename in the form of a string value, for example

500 MERGE "prog2"

The filename following MERGE is the name of the program to be merged with the program currently in memory. This name is subject to the same restrictions as program names used with LOAD. MERGE then loads the new program without first deleting the existing program. However, the new program overwrites any lines in the existing program that have the same line numbers as lines in the new program, and variables with the same name are also overwritten.

MERGE and the silicon disc

MERGE can also be used to access a file stored on the 128k Spectrum's silicon disc. To do this, insert a ! character between the keyword MERGE and the filename, for example

MERGE !"bar"

If a program is well structured, then up to 91kb of BASIC code can be stored in the 128k memory model.

Format

  • MERGE string-expr

See also

Chapter 20.

  • 128k Commands in BASin