HP 3000 Manuals

Ch 3. Input/Output [ HP Pascal/iX Programmer's Guide ] MPE/iX 5.0 Documentation


HP Pascal/iX Programmer's Guide

Chapter 3  Input/Output 

Input/output depends on files:  your program reads input from files and
writes output to files.  The terms that describe the three varieties of
input/output--sequential, textfile, and direct--also describe the
associated files.

This chapter:

   *   Gives general information about files.

   *   Explains the predefined file-opening procedures and how they
       determine whether files are sequential or direct, for input or for
       output.

   *   Defines sequential as it applies to input/output and files, and
       explains the predefined routines that support sequential I/O.

   *   Explains textfile input/output and files, which are subsets of
       sequential I/O and files (respectively), and explains the routines
       peculiar to them.

   *   Defines direct as it applies to input/output and files, and
       explains the predefined routines that support direct I/O.

   *   Gives the conditions under which files are closed, and tells what
       happens when a file closes.

Figure 3-1  illustrates the relationships between sequential,
textfile, and direct input/output and sequential files, textfiles, and
direct files.

[]
Figure 3-1. Relationships Between I/O Varieties and File Types Input/output also depends upon the procedures that manipulate files and the functions that return information about them. Table 3-1 categorizes the predefined input/output routines two ways: by purpose (for example, input or output) and by I/O type (sequential, textfile, or direct). Table 3-1. Categories of Input/Output Routines ------------------------------------------------------------------------------------------------- | | | | | | | Sequential I/O | Textfile I/O | Direct I/O | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | Opening Procedures | | | | | | reset | reset | open | | | rewrite | rewrite | | | | append | append | | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | Input Procedures | | | | | | get | get | get | | | read | read | read | | | | readln | readdir | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | Output Procedures | | | | | | put | put | put | | | write | write | write | | | | writeln | writedir | | | | page | | | | | prompt | | | | | overprint | | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | Positioning Procedure | None | None | seek | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | Association | | | | | Procedures | associate | associate | associate | | | disassociate | disassociate | disassociate | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | Status Functions | | | | | | eof | eof | eof | | | | eoln | lastpos | | | | linepos | maxpos | | | position | | position | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | Closing Procedure | close | close | close | | | | | | -------------------------------------------------------------------------------------------------


MPE/iX 5.0 Documentation