comp.lang.ada
 help / color / mirror / Atom feed
* Re: File IO problem
@ 2002-12-06  7:07 Grein, Christoph
  0 siblings, 0 replies; 4+ messages in thread
From: Grein, Christoph @ 2002-12-06  7:07 UTC (permalink / raw)


> with text_Io;
> use text_io;
> Procedure FILE_IO_DEMO is
>    FILE_I, FILE_O : FILE_TYPE;
>    S : STRING(1..80);
>    Len : Integer;
> begin
>    open (FILE_I, IN_FILE,"junk.txt");
>    create(FILE_O, OUT_FILE, "output.txt");
>    while END_OF_FILE(FILE_I) loop
          ^   <-- insert here
         not
>       GET_LINE(FILE_I, S, Len);
>       PUT_LINE(S(1..LEN));
>       PUT_LINE(FILE_O,S(1..Len));
>    end loop;
> end;
> 
> The contents of the file junk.txt is
> lafeosbv 
> qfowep p4gowb
> hfwevwpbv
> 
> The program is creating output.txt but it contents are nil.
> 
> Pls let me know if I am doing wrong.Any help will be appriciated.



^ permalink raw reply	[flat|nested] 4+ messages in thread
* File IO problem
@ 2002-12-06  6:27 prashna
  2002-12-06  7:14 ` Martin Dowie
  2002-12-06 17:13 ` Jeffrey Carter
  0 siblings, 2 replies; 4+ messages in thread
From: prashna @ 2002-12-06  6:27 UTC (permalink / raw)


Hi all,
Pls have a look at the following code

with text_Io;
use text_io;
Procedure FILE_IO_DEMO is
   FILE_I, FILE_O : FILE_TYPE;
   S : STRING(1..80);
   Len : Integer;
begin
   open (FILE_I, IN_FILE,"junk.txt");
   create(FILE_O, OUT_FILE, "output.txt");
   while END_OF_FILE(FILE_I) loop
      GET_LINE(FILE_I, S, Len);
      PUT_LINE(S(1..LEN));
      PUT_LINE(FILE_O,S(1..Len));
   end loop;
end;

The contents of the file junk.txt is
lafeosbv 
qfowep p4gowb
hfwevwpbv

The program is creating output.txt but it contents are nil.

Pls let me know if I am doing wrong.Any help will be appriciated.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-06 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-06  7:07 File IO problem Grein, Christoph
  -- strict thread matches above, loose matches on Subject: below --
2002-12-06  6:27 prashna
2002-12-06  7:14 ` Martin Dowie
2002-12-06 17:13 ` Jeffrey Carter

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