## Using File Input / Output: Introduction

This chapter explains how to input and output information to and from your part programs. The available menu options allow for opening files in read or write mode. Data can then be read from or written to these files. The File I / O commands allow data to be read in from external files that are to be used in a part program . Also, measurement and tolerancing information can be written back out to files using these commands. You can also perform other file operations by using these commands.

This chapter details these file I/O operations and includes functional examples for each of the various operations. These examples use items discussed in the "Branching by Using Flow Control" chapter and the "Using Expressions and Variables" chapter.

Note: When looping or branching occurs in the code samples, indentation has been used for clarity to show statements assigned to a certain condition. In the actual Edit window code, you won't see any indentation.

The main topics described in this topic include:

- Understanding Basic File I/O Concepts

- Using the File I/O Dialog Box

- Opening a File for Reading or Writing

- Closing an Opened File after Reading or Writing

- Reading a Character from a File

- Reading a Line from a File

- Reading a Block of Text from a File

- Reading Text up to a Delimiter

- Writing a Character to a File

- Writing a Line to a File

- Writing a Block of Text to a File

- Positioning a File Pointer at the Beginning of a File

- Saving a File Pointer's Current Position

- Recalling a Saved File Pointer's Position

- Copying a File

- Moving a File

- Deleting a File

- Checking for a File's Existence

- Displaying a File Dialog Box

- Checking for the End of a File or the End of a Line