Performing File Operations in a Program


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


Important Concept!

The key sequence for executing file operations into a program is different from that used in keyboard commands. In the learn mode, the calculator prompts you only for the type of file operation and does not display menus for other information, such as the file name.

Within a program you must specify:
  • Which data registers are to be used (if the file is a data file).
  • Which directory is to be used.
  • The name of the file, including the required + sign if the file is a data file.

Specifying the Data Registers

For a program that saves data, you must ensure the value nnn.sss (as described on this page) is in the numeric display register before executing a { PUT }.

For a program that loads data, you must ensure the number of the starting register is in the numeric display register before executing { GET }.

Specifying the Directory

For a program that performs a file operation using a Constant Memory cartridge, you must use the [ INV ] key immediately preceding the function to specify the cartridge as the directory to be used. The only exception to this is the { NAM } function, which always accesses the cartridge and does not required [ INV ].

To specify the cartridge as the directory, press [ INV ] before you select any of the file operations { PUT }, { GET }, { DF }, { CD }, or { CAT }.

If you do not use [ INV ], the calculator uses the file space ( MEM ) as the directory.

Specifying the Name and Type of File

For any file operation that requires a file name, such as { PUT } and { GET }, you must enter the file name immediately following the operation. If you use fewer than three characters, the calculator adds trailing spaces. (You do not activate the alpha mode to enter the name; the calculator interprets the keys as alpha characters.)

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

Sample Key Sequences

The following samples show some key sequences typical of those you might enter in the learn mode for performing file operations from a program.

[ FILES ] 10.002
[ INV ] { PUT } +GP
Saves 10 registers (starting with register 002) as a data file named +GP in the cartridge.

[ FILES ] 5 { GET } +CALoads the data file named +CA from the file space into data registers, starting at register 005.

[ FILES ] [ INV ] { DF } ABCDeletes the program file named ABC from the cartridge.


Back