comp.lang.ada
 help / color / mirror / Atom feed
From: marcus@fkihh.UUCP (Marcus Moehrmann)
Subject: TEXT_IO
Date: 11 May 88 16:46:51 GMT	[thread overview]
Date: Wed May 11 17:46:51 1988
Message-ID: <340@fkihh.UUCP> (raw)

Hello,
I have a question concerning TEXT_IO. Consider the following program:

with TEXT_IO;
use  TEXT_IO;
procedure TEST is
begin
--   SET_INPUT  (STANDARD_INPUT);    -- (1)
--   SET_OUTPUT (STANDARD_OUTPUT);   -- (1)
   DO_SOMETHING;
   PUT_LINE ("After doing something");   -- (2)
end TEST;

Now, LRM 14.3(5) states, that the standard IO files are open *at the
beginning* of the program execution and have the appropriate modes.

But what has to be done, if they cannot be opened because of
NAME_ERROR or USE_ERROR ? E.g. with VAX/VMS you can do the following:
   $ DEFINE ADA$OUTPUT <filename-which-raises-io-error-at-TEXT_IO.CREATE>
and something equal for ADA$INPUT. After that STANDARD_OUTPUT cannot
be opened at the beginning of the program execution. I think, the same
can be done in other operating-systems like UNIX or MS/DOS.

Now the question is, *when* to raise the IO error, e.g. NAME_ERROR ?
During elaboration of TEXT_IO, at first use of STANDARD_IO ?

This is what happens with VAX Ada V1.4-33:

   If statements (1) are active, NAME_ERROR will be raised here 

   If statement (1) are commented out, NAME_ERROR will be raised at (2),
   after doing something else.
   
Therefor in Vax Ada statements (1) are neccessary to prevent doing
something after the beginning of the program execution but befor an IO
statement is reached. I feel, that there must not be a difference if
statements (1) are active or not (commented out).


*** Marcus Moehrmann                |  UUCP:    marcus@fkihh.UUCP ***
*** (TeX: M\"{o}hrmann)             |  PHONE:   +49-40-4123-2573  ***
*** Univ of Hamburg, W. Germany     |           +49-40-5202464    ***

             reply	other threads:[~1988-05-11 16:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-05-11 16:46 Marcus Moehrmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-04-22  0:00 Text IO Chris O'Regan
1995-04-22  0:00 ` Tore Joergensen
2001-08-28 16:19 Matt Raikes
2001-08-28 16:28 ` martin.m.dowie
2001-08-28 16:47 ` Marin David Condic
2001-08-28 18:33 ` Ted Dennison
2001-08-29  8:50 ` John McCabe
2001-09-01  1:15   ` Robert Dewar
2001-09-03  8:23     ` John McCabe
2001-09-03 11:11       ` David C. Hoos, Sr.
2001-09-03 12:05         ` John McCabe
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox