[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]


TYPE: Command
FORMAT: LOAD["<file-name>"][,<device>][,<address>]

Action: The LOAD statement reads the contents of a program file from tape or disk into memory. That way you can use the information LOADed or change the information in some way. The device number is optional, but when it is left out the computer will automatically default to 1, the cassette unit. The disk unit is normally device number 8. The LOAD closes all open files and, if it is used in direct mode, it performs a CLR (clear) before reading the program. If LOAD is executed from within a program, the program is RUN. This means that you can use LOAD to "chain" several programs together. None of the variables are cleared during a chain operation.

If you are using file-name pattern matching, the first file which matches the pattern is loaded. The asterisk in quotes by itself ("*") causes the first file-name in the disk directory to be loaded. if the filename used does not exist or if it is not a program file, the BASIC error message ?FILE NOT FOUND occurs.

When LOADing programs from tape, the <file-name> can be left out, and the next program file on the tape will be read. The Commodore 64 will blank the screen to the border color after the PLAY key is pressed. When the program is found, the screen clears to the background color and the "FOUND" message is displayed. When the <C=> key, <CTRL> key, <ARROW LEFT> key, or <SPACE BAR> is pressed, the file will be loaded. Programs will LOAD starting at memory location 2048 unless a secondary <address> of 1 is used. If you use the secondary address of 1 this will cause the program to LOAD to the memory location from which it was saved.

[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated November 14, 1998.