Performing External File Operations in a Program


You can design a program so that it performs its own external file operations. After you are familiar with using external file operations from the keyboard, read this section to learn how to use them within a program.


Important Concept

When you perform external file storage operations within a program, you use a different sequence of keystrokes.

In the learn mode, the calculator prompts you only for the type of external file operation; it does not display menus for other information, such as the file name. (When you run the program, however, the calculator still displays prompts to press OK at the various file I/O steps.)

Within the program, you must specify:
  • Which data registers are to be used (if the file is a data file).
  • The name and type of the file.

Specifying the Data Registers

For a program that writes data, you must ensure that the value nnn.sss (described in this section of the guide) is in the numeric display register before the program executes WRT.

For a program that reads or verifies data, you must ensure that the number of the starting register is in the numeric display register before the program executes RD or VFY.

Specifying the Name and Type of File

To specify a file name, enter the file name immediately after the tape operation key. If you use fewer than three characters, the calculator adds trailing spaces. (You do not activate the alpha mode to fill in this field.)

If the file is a data file, you must include the required + (plus sign) as the first character of the file name.

Sample Instruction Sequences

The following examples show instruction sequences typical of those you might use for performing external file operations within a program.

[ I/O ] { Pad }
10.002 { WRT } +GP
Writes 10 registers (starting with register 002) as a data file named +GP.

[ I/O ] { Pad }
5 { RD } +CA
Reads the data file named +CA into data registers, starting at register 005.

[ I/O ] { Pad } { VFY } MTKVerifies that the program in memory matches the program file named MTK.

When the program performs any of these key sequences, the calculator prompts you to press OK at the various file I/O stages described earlier.


Back