comp.lang.ada
 help / color / mirror / Atom feed
* simple problem?
@ 1996-05-09  0:00 Frank Cheung
  1996-05-10  0:00 ` Robert I. Eachus
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Frank Cheung @ 1996-05-09  0:00 UTC (permalink / raw)



Hello!

When I try to compile the code below, I get the following error:

"/usr/Ada/lib/sequential_i.A", line 67: error: 
generic formal private type element_type has unconstrained 

Can anyone help me out with this?  The code is as follows:

with SEQUENTIAL_IO; 

procedure MAIN is

   package TEXT_IO is new SEQUENTIAL_IO(STRING);
   use TEXT_IO;

   FileName : STRING(1..12) := "hoaxfile.dat";

   Time_Of_Call : STRING(1..12);
   Caller_Description : STRING(1..400);

   procedure CREATE_HOAX_FILE is
      CallFile : FILE_TYPE;
   begin
      create(CallFile, NAME=>FileName);
      write(CallFile, "Hoax/Complaint file created on 9th May, 1996");
      close(CallFile);
   end CREATE_HOAX_FILE;

   procedure OUTPUT_HOAX_FILE is
      CallFile : FILE_TYPE;
   begin
      open(CallFile, IN_FILE, FileName);
      while not END_OF_FILE(CallFile) loop 
         read(CallFile, Time_Of_Call);
         read(CallFile, Caller_Description);
      end loop;
   close(CallFile);
   end OUTPUT_HOAX_FILE;

   procedure APPEND_HOAX_FILE(Time_Of_Call, Caller_Description:STRING) is
      CallFile : FILE_TYPE;
   begin
      open(CallFile, OUT_FILE, FileName);
      write(CallFile, Time_Of_Call);
      write(CallFile, Caller_Description);
      close(CallFile);
   end APPEND_HOAX_FILE;

begin 
   CREATE_HOAX_FILE;
   APPEND_HOAX_FILE("12:00", "Ben");
   APPEND_HOAX_FILE("12:15", "Adam");
   APPEND_HOAX_FILE("18:00", "Frank");
end; 

Any comments/suggestions would be appreciated.  Thanks.

Frank.

  ________________Frank Cheung | Computer Science (BSc) Year 2_______________
 /   fktc101@york.ac.uk | 0881-800800 a/c 841276 | +44-1904-430000 ext 4250  \
|James College, University of York, Heslington, Y01 5DD, York, United Kingdom|





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

end of thread, other threads:[~1996-05-14  0:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-09  0:00 simple problem? Frank Cheung
1996-05-10  0:00 ` Robert I. Eachus
1996-05-10  0:00   ` Kevin D. Heatwole
1996-05-10  0:00 ` John English
1996-05-10  0:00   ` Robert A Duff
1996-05-13  0:00     ` John English
1996-05-13  0:00       ` Robert A Duff
1996-05-14  0:00       ` Keith Thompson
1996-05-10  0:00 ` John Herro

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