home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / lrm / chap14.err < prev    next >
Encoding:
Text File  |  1988-05-03  |  12.1 KB  |  266 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                            Errata for changes to chapter 14 version 21
  7.  
  8.  
  9.  
  10. 14 14 14
  11.  
  12.  
  13. References:___________ direct_io package 14.2 14.2.4, io_exceptions package 14.5, low_level_io package  14.6,
  14. sequential_io package 14.2 14.2.2, text_io package 14.3
  15.  
  16.  
  17.  
  18. 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)
  19.  
  20.  
  21. In  order  to  define  sequential  input-output for a given element type, an instantiation of this
  22. generic unit, with the given type as actual parameter, must be declared.   The  resulting  package
  23. contains  the declaration of a file type (called FILE_TYPE) for files of such elements, as well as
  24. the operations applicable to these files, such as the OPEN, READ, and WRITE procedures.
  25.  
  26.  
  27.  
  28. 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)
  29.  
  30.  
  31. The exceptions that can be raised by a call of an input-output subprogram are all defined  in  the
  32. package  IO_EXCEPTIONS;   the  situations  in  which   they  can  be  raised are described, either
  33. following the description of the subprogram (and in section 14.4), or in Appendix F in the case of
  34. error situations that are implementation-dependent.
  35.  
  36.  
  37.  
  38. 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)
  39.  
  40.  
  41. References:___________ create procedure 14.2.1, current index  14.2,  current  size  14.2,  delete  procedure
  42. 14.2.1,  direct  access 14.2, direct file procedure 14.2, direct_io package 14.1 14.2, enumeration
  43. type 3.5.1, exception 11, file mode 14.2.3, generic instantiation 12.3,  index  14.2,  input  file
  44. 14.2.2,  io_exceptions  package  14.5,  open file 14.1, open procedure 14.2.1, output file 14.2.2,
  45. read procedure 14.2.4, sequential access  14.2,  sequential  file  14.2,  sequential  input-output
  46. 14.2.2,  sequential_io  package  14.2  14.2.2, string 3.6.3, text_io package 14.3, write procedure
  47. 14.2.4
  48.  
  49.  
  50.  
  51. 14.2.2  Sequential Input-Output (paragraph 7)14.2.2  Sequential Input-Output (paragraph 7)14.2.2  Sequential Input-Output (paragraph 7)
  52.  
  53.  
  54. The exception MODE_ERROR is raised if the mode is not OUT_FILE.  The exception USE_ERROR is raised
  55. if the capacity of the external file is exceeded.
  56.  
  57.  
  58.  
  59. 14.2.2  Sequential Input-Output (paragraph 11)14.2.2  Sequential Input-Output (paragraph 11)14.2.2  Sequential Input-Output (paragraph 11)
  60.  
  61.  
  62. References:___________ data_error exception 14.4, element 14.1, element_type 14.1, end_error exception  14.4,
  63. external  file 14.1, file 14.1, file mode 14.1, file_type 14.1, in_file 14.1, mode_error exception
  64.  
  65.  
  66.  
  67. -1                                                   Sequential Input-Output (paragraph 11) 14.2.2
  68.  
  69.  
  70.  
  71.  
  72. 14.4, out_file 14.1, status_error exception 14.4, use_error exception 14.4
  73.  
  74.  
  75.  
  76. 14.2.4  Direct Input-Output (paragraph 7)14.2.4  Direct Input-Output (paragraph 7)14.2.4  Direct Input-Output (paragraph 7)
  77.  
  78.  
  79. The exception MODE_ERROR is raised if the mode of  the  given  file  is  IN_FILE.   The  exception
  80. USE_ERROR is raised if the capacity of the external file is exceeded.
  81.  
  82.  
  83.  
  84. 14.2.4  Direct Input-Output (paragraph 13)14.2.4  Direct Input-Output (paragraph 13)14.2.4  Direct Input-Output (paragraph 13)
  85.  
  86.  
  87. Operates  on a file of any mode.  Returns the current size of the external file that is associated
  88. with the given file.
  89.  
  90.  
  91.  
  92. 14.2.4  Direct Input-Output (paragraph 17)14.2.4  Direct Input-Output (paragraph 17)14.2.4  Direct Input-Output (paragraph 17)
  93.  
  94.  
  95. References:___________ count type 14.2, current index 14.2, current size  14.2,  data_error  exception  14.4,
  96. element  14.1,  element_type  14.1,  end_error exception 14.4, external file 14.1, file 14.1, file
  97. mode 14.1, file_type 14.1, in_file 14.1, index 14.2, inout_file 14.1, mode_error  exception  14.4,
  98. open file 14.1, positive_count 14.3, status_error exception 14.4, use_error exception 14.4
  99.  
  100.  
  101.  
  102. 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)
  103.  
  104.  
  105. References__________  close procedure 14.2.1, count type 14.2, create procedure 14.2.1, data_error exception
  106. 14.4, default_mode 14.2.5, delete procedure  14.2.1,  device_error  exception  14.4,  element_type
  107. 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,
  108. form   function   14.2.1,  in_file  14.2.4,  index  function  14.2.4,  inout_file  14.2.4  14.2.1,
  109. io_exceptions package 14.4, is_open function 14.2.1, mode function  14.2.1,  mode_error  exception
  110. 14.4,  name  function  14.2.1,  name_error exception 14.4, open procedure 14.2.1, out_file 14.2.1,
  111. read procedure 14.2.4, set_index procedure 14.2.4, size function  14.2.4,  status_error  exception
  112. 14.4, use_error exception 14.4, write procedure 14.2.4 14.2.1
  113.  
  114.  
  115.  
  116. 14.3  Text Input-Output (paragraph 9)14.3  Text Input-Output (paragraph 9)14.3  Text Input-Output (paragraph 9)
  117.  
  118.  
  119. For  an  output  file,  a  maximum_______  line____  length______ can be specified and a maximum_______ page____ length______ can be
  120. specified.  If a value to be output cannot fit on the current line, for a specified  maximum  line
  121. length,  then  a  new line is automatically started before the value is output;  if, further, this
  122. new line cannot fit on the current page, for a specified maximum page length, then a new  page  is
  123. automatically started before the value is output.  Functions are provided to determine the maximum
  124. line  length  and  the maximum page length.  When a file is opened with mode OUT_FILE, both values
  125. are zero:  by convention, this means that  the  line  lengths  and  page  lengths  are  unbounded.
  126. (Consequently,  output  consists  of a single line if the subprograms for explicit control of line
  127. and page structure are not used.)  The constant UNBOUNDED is provided for this purpose.
  128.  
  129.  
  130.  
  131.  
  132.  
  133. 14.3 Text Input-Output (paragraph 9)                                                            -2
  134.  
  135.  
  136.  
  137.  
  138. 14.3.1  File Management (paragraph 6)14.3.1  File Management (paragraph 6)14.3.1  File Management (paragraph 6)
  139.  
  140.  
  141. References:___________ create procedure 14.2.1, current column number 14.3, current default input file  14.3,
  142. current  line  number  14.3,  current page number 14.3, end_of_file 14.3, external file 14.1, file
  143. 14.1, file mode 14.1, file terminator 14.3, in_file 14.1, line length 14.3,  mode_error  exception
  144. 14.4, open procedure 14.2.1, out_file 14.1, page length 14.3, reset procedure 14.2.1
  145.  
  146.  
  147.  
  148. 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)
  149.  
  150.  
  151. References:___________  current  default  file 14.3, default file 14.3, file_type 14.1, get procedure 14.3.5,
  152. mode_error exception 14.4, put procedure 14.3.5, status_error exception 14.4
  153.  
  154.  
  155.  
  156. 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)
  157.  
  158.  
  159. In the examples, here and in sections 14.3.7 and 14.3.8, the string  quotes  and  the  lower  case
  160. letter b are not transferred:  they are shown only to reveal the layout and spaces.
  161.  
  162.  
  163.  
  164. 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)
  165.  
  166.  
  167. Outputs  the  value  of the parameter ITEM as an integer literal, with no underlines, no exponent,
  168. and no leading zeros (but a single zero for the value zero), and a  preceding  minus  sign  for  a
  169. negative value.
  170.  
  171.  
  172.  
  173. 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)
  174.  
  175.  
  176. Uses  the syntax for decimal literal if the parameter BASE has the value ten (either explicitly or
  177. through DEFAULT_BASE);  otherwise, uses the syntax for based literal, with any  letters  in  upper
  178. case.
  179.  
  180.  
  181.  
  182. 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)
  183.  
  184.  
  185. Examples:_________
  186.  
  187.     packagepackagepackage INT_IO isisis newnewnew INTEGER_IO(SMALL_INT); useuseuse INT_IO;
  188.     -- default format used at instantiation, DEFAULT_WIDTH = 4, DEFAULT_BASE = 10
  189.  
  190.     PUT(126);                            -- "b126"
  191.     PUT(-126, 7);                        -- "bbb-126"
  192.     PUT(126, WIDTH => 13, BASE => 2);    -- "bbb2#1111110#"
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199. -3                                            Input-Output for Integer Types (paragraph 18) 14.3.7
  200.  
  201.  
  202.  
  203.  
  204. 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)
  205.  
  206.  
  207. References:___________  aft attribute 3.5.10, based literal 2.4.2, blank 14.3.5, data_error exception 14.3.5,
  208. decimal literal 2.4.1, field subtype 14.3.5, file_type 14.1, fixed_io package 14.3.10, floating_io
  209. package 14.3.10, fore attribute 3.5.10, get procedure 14.3.5, layout_error 14.3.5, line terminator
  210. 14.3.5, put procedure 14.3.5, real literal 2.4, skipping 14.3.5, width 14.3.5
  211.  
  212.  
  213.  
  214. 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)
  215.  
  216.  
  217. Outputs the value of the parameter ITEM as an enumeration  literal  (either  an  identifier  or  a
  218. character literal).  The optional parameter SET indicates whether lower case or upper case is used
  219. for identifiers;  it has no effect for character literals.  If the sequence of characters produced
  220. has  fewer  than  WIDTH  characters,  then  trailing  spaces  are  finally  output  to make up the
  221. difference.
  222.  
  223.  
  224.  
  225. 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
  226.  
  227.  
  228.  
  229.        -- Generic packages for Input-Output of Real Types
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265. 14.3.10 Specification of the Package Text_IO                                                    -4
  266.