home *** CD-ROM | disk | FTP | other *** search
Wrap
Errata for changes to chapter 14 version 21 14 14 14 References:___________ direct_io package 14.2 14.2.4, io_exceptions package 14.5, low_level_io package 14.6, sequential_io package 14.2 14.2.2, text_io package 14.3 14.1 External Files and File Objects (paragraph 5)14.1 External Files and File Objects (paragraph 5)14.1 External Files and File Objects (paragraph 5) In order to define sequential input-output for a given element type, an instantiation of this generic unit, with the given type as actual parameter, must be declared. The resulting package contains the declaration of a file type (called FILE_TYPE) for files of such elements, as well as the operations applicable to these files, such as the OPEN, READ, and WRITE procedures. 14.1 External Files and File Objects (paragraph 11)14.1 External Files and File Objects (paragraph 11)14.1 External Files and File Objects (paragraph 11) The exceptions that can be raised by a call of an input-output subprogram are all defined in the package IO_EXCEPTIONS; the situations in which they can be raised are described, either following the description of the subprogram (and in section 14.4), or in Appendix F in the case of error situations that are implementation-dependent. 14.1 External Files and File Objects (paragraph 14)14.1 External Files and File Objects (paragraph 14)14.1 External Files and File Objects (paragraph 14) References:___________ create procedure 14.2.1, current index 14.2, current size 14.2, delete procedure 14.2.1, direct access 14.2, direct file procedure 14.2, direct_io package 14.1 14.2, enumeration type 3.5.1, exception 11, file mode 14.2.3, generic instantiation 12.3, index 14.2, input file 14.2.2, io_exceptions package 14.5, open file 14.1, open procedure 14.2.1, output file 14.2.2, read procedure 14.2.4, sequential access 14.2, sequential file 14.2, sequential input-output 14.2.2, sequential_io package 14.2 14.2.2, string 3.6.3, text_io package 14.3, write procedure 14.2.4 14.2.2 Sequential Input-Output (paragraph 7)14.2.2 Sequential Input-Output (paragraph 7)14.2.2 Sequential Input-Output (paragraph 7) The exception MODE_ERROR is raised if the mode is not OUT_FILE. The exception USE_ERROR is raised if the capacity of the external file is exceeded. 14.2.2 Sequential Input-Output (paragraph 11)14.2.2 Sequential Input-Output (paragraph 11)14.2.2 Sequential Input-Output (paragraph 11) References:___________ data_error exception 14.4, element 14.1, element_type 14.1, end_error exception 14.4, external file 14.1, file 14.1, file mode 14.1, file_type 14.1, in_file 14.1, mode_error exception -1 Sequential Input-Output (paragraph 11) 14.2.2 14.4, out_file 14.1, status_error exception 14.4, use_error exception 14.4 14.2.4 Direct Input-Output (paragraph 7)14.2.4 Direct Input-Output (paragraph 7)14.2.4 Direct Input-Output (paragraph 7) The exception MODE_ERROR is raised if the mode of the given file is IN_FILE. The exception USE_ERROR is raised if the capacity of the external file is exceeded. 14.2.4 Direct Input-Output (paragraph 13)14.2.4 Direct Input-Output (paragraph 13)14.2.4 Direct Input-Output (paragraph 13) Operates on a file of any mode. Returns the current size of the external file that is associated with the given file. 14.2.4 Direct Input-Output (paragraph 17)14.2.4 Direct Input-Output (paragraph 17)14.2.4 Direct Input-Output (paragraph 17) References:___________ count type 14.2, current index 14.2, current size 14.2, data_error exception 14.4, element 14.1, element_type 14.1, end_error exception 14.4, external file 14.1, file 14.1, file mode 14.1, file_type 14.1, in_file 14.1, index 14.2, inout_file 14.1, mode_error exception 14.4, open file 14.1, positive_count 14.3, status_error exception 14.4, use_error exception 14.4 14.2.5 Specification of the Package Direct_IO (paragraph 2)14.2.5 Specification of the Package Direct_IO (paragraph 2)14.2.5 Specification of the Package Direct_IO (paragraph 2) References__________ close procedure 14.2.1, count type 14.2, create procedure 14.2.1, data_error exception 14.4, default_mode 14.2.5, delete procedure 14.2.1, device_error exception 14.4, element_type 14.2.4, end_error exception 14.4, end_of_file function 14.2.4, file_mode 14.2.5, file_type 14.2.4, form function 14.2.1, in_file 14.2.4, index function 14.2.4, inout_file 14.2.4 14.2.1, io_exceptions package 14.4, is_open function 14.2.1, mode function 14.2.1, mode_error exception 14.4, name function 14.2.1, name_error exception 14.4, open procedure 14.2.1, out_file 14.2.1, read procedure 14.2.4, set_index procedure 14.2.4, size function 14.2.4, status_error exception 14.4, use_error exception 14.4, write procedure 14.2.4 14.2.1 14.3 Text Input-Output (paragraph 9)14.3 Text Input-Output (paragraph 9)14.3 Text Input-Output (paragraph 9) For an output file, a maximum_______ line____ length______ can be specified and a maximum_______ page____ length______ can be specified. If a value to be output cannot fit on the current line, for a specified maximum line length, then a new line is automatically started before the value is output; if, further, this new line cannot fit on the current page, for a specified maximum page length, then a new page is automatically started before the value is output. Functions are provided to determine the maximum line length and the maximum page length. When a file is opened with mode OUT_FILE, both values are zero: by convention, this means that the line lengths and page lengths are unbounded. (Consequently, output consists of a single line if the subprograms for explicit control of line and page structure are not used.) The constant UNBOUNDED is provided for this purpose. 14.3 Text Input-Output (paragraph 9) -2 14.3.1 File Management (paragraph 6)14.3.1 File Management (paragraph 6)14.3.1 File Management (paragraph 6) References:___________ create procedure 14.2.1, current column number 14.3, current default input file 14.3, current line number 14.3, current page number 14.3, end_of_file 14.3, external file 14.1, file 14.1, file mode 14.1, file terminator 14.3, in_file 14.1, line length 14.3, mode_error exception 14.4, open procedure 14.2.1, out_file 14.1, page length 14.3, reset procedure 14.2.1 14.3.2 Default Input and Output Files (paragraph 17)14.3.2 Default Input and Output Files (paragraph 17)14.3.2 Default Input and Output Files (paragraph 17) References:___________ current default file 14.3, default file 14.3, file_type 14.1, get procedure 14.3.5, mode_error exception 14.4, put procedure 14.3.5, status_error exception 14.4 14.3.5 Get and Put Procedures (paragraph 12)14.3.5 Get and Put Procedures (paragraph 12)14.3.5 Get and Put Procedures (paragraph 12) In the examples, here and in sections 14.3.7 and 14.3.8, the string quotes and the lower case letter b are not transferred: they are shown only to reveal the layout and spaces. 14.3.7 Input-Output for Integer Types (paragraph 10)14.3.7 Input-Output for Integer Types (paragraph 10)14.3.7 Input-Output for Integer Types (paragraph 10) Outputs the value of the parameter ITEM as an integer literal, with no underlines, no exponent, and no leading zeros (but a single zero for the value zero), and a preceding minus sign for a negative value. 14.3.7 Input-Output for Integer Types (paragraph 12)14.3.7 Input-Output for Integer Types (paragraph 12)14.3.7 Input-Output for Integer Types (paragraph 12) Uses the syntax for decimal literal if the parameter BASE has the value ten (either explicitly or through DEFAULT_BASE); otherwise, uses the syntax for based literal, with any letters in upper case. 14.3.7 Input-Output for Integer Types (paragraph 18)14.3.7 Input-Output for Integer Types (paragraph 18)14.3.7 Input-Output for Integer Types (paragraph 18) Examples:_________ packagepackagepackage INT_IO isisis newnewnew INTEGER_IO(SMALL_INT); useuseuse INT_IO; -- default format used at instantiation, DEFAULT_WIDTH = 4, DEFAULT_BASE = 10 PUT(126); -- "b126" PUT(-126, 7); -- "bbb-126" PUT(126, WIDTH => 13, BASE => 2); -- "bbb2#1111110#" -3 Input-Output for Integer Types (paragraph 18) 14.3.7 14.3.8 Input-Output for Real Types (paragraph 24)14.3.8 Input-Output for Real Types (paragraph 24)14.3.8 Input-Output for Real Types (paragraph 24) References:___________ aft attribute 3.5.10, based literal 2.4.2, blank 14.3.5, data_error exception 14.3.5, decimal literal 2.4.1, field subtype 14.3.5, file_type 14.1, fixed_io package 14.3.10, floating_io package 14.3.10, fore attribute 3.5.10, get procedure 14.3.5, layout_error 14.3.5, line terminator 14.3.5, put procedure 14.3.5, real literal 2.4, skipping 14.3.5, width 14.3.5 14.3.9 Input-Output for Enumeration Types 14.3.9 (paragraph 9)14.3.9 Input-Output for Enumeration Types 14.3.9 (paragraph 9)14.3.9 Input-Output for Enumeration Types 14.3.9 (paragraph 9) Outputs the value of the parameter ITEM as an enumeration literal (either an identifier or a character literal). The optional parameter SET indicates whether lower case or upper case is used for identifiers; it has no effect for character literals. If the sequence of characters produced has fewer than WIDTH characters, then trailing spaces are finally output to make up the difference. 14.3.10 Specification of the Package Text_IO14.3.10 Specification of the Package Text_IO14.3.10 Specification of the Package Text_IO -- Generic packages for Input-Output of Real Types 14.3.10 Specification of the Package Text_IO -4