home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / programm / prog2 / multout.ada < prev    next >
Encoding:
Text File  |  1991-07-01  |  1.5 KB  |  72 lines

  1.                                        -- Chapter 14 - Program 3
  2. with Text_IO;
  3. use Text_IO;
  4.  
  5. procedure MultOut is
  6.  
  7.    package Int_IO is new Text_IO.Integer_IO(INTEGER);
  8.    use Int_IO;
  9.  
  10.    Numbers, Some_Text, More_Text : FILE_TYPE;
  11.    Index : INTEGER;
  12.  
  13. begin
  14.  
  15.    Create(Numbers,Out_File,"INTDATA.TXT");
  16.    Create(Some_Text,Out_File,"TEST.TXT");
  17.    Create(More_Text,Out_File,"CHARACTS.TXT");
  18.  
  19.    for Count in 3..5 loop
  20.       Put(Some_Text,"This line goes to the TEST.TXT file.");
  21.       Put(More_Text,"This line goes to the CHARACTS.TXT file.");
  22.       for Count2 in 12..16 loop
  23.          Put(Numbers,Count + Count2);
  24.       end loop;
  25.       New_Line(More_Text);
  26.       New_Line(Numbers,2);
  27.       New_Line(Some_Text);
  28.    end loop;
  29.  
  30.    Put_Line("INTDATA.TXT, TEST.TXT, and CHARACTS.TXT are ready.");
  31.  
  32.    Close(Numbers);
  33.    Close(Some_Text);
  34.    Close(More_Text);
  35.  
  36. end MultOut;
  37.  
  38.  
  39.  
  40.  
  41. -- Results of execution
  42.  
  43.  
  44. -- (Output to the monitor)
  45. --
  46. -- INTDATA.TXT, TEST.TXT, and CHARACTS.TXT are ready.
  47.  
  48.  
  49. -- (Output to the file named INTDATA.TXT)
  50. --
  51. --     15    16    17    18    19
  52. --
  53. --     16    17    18    19    20
  54. --
  55. --     17    18    19    20    21
  56. --
  57.  
  58.  
  59. -- (Output to the file named TEST.TXT)
  60. --
  61. -- This line goes to the TEST.TXT file.
  62. -- This line goes to the TEST.TXT file.
  63. -- This line goes to the TEST.TXT file.
  64.  
  65.  
  66. -- Output to the file named CHARACTS.TXT)
  67. --
  68. -- This line goes to the CHARACTS.TXT file.
  69. -- This line goes to the CHARACTS.TXT file.
  70. -- This line goes to the CHARACTS.TXT file.
  71.  
  72.