From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b2f463dd5856d07a,start X-Google-Attributes: gid103376,public From: "Robert A. Thompson" Subject: Got me stumped any idea? Date: 1997/10/11 Message-ID: <343F77BF.18CA@unx1.shsu.edu>#1/1 X-Deja-AN: 279476272 Organization: Sam Houston State University Reply-To: stdrat01@unx1.shsu.edu Newsgroups: comp.lang.ada Date: 1997-10-11T00:00:00+00:00 List-Id: I have been working on some stuff here recently and thought that Ada would be a good compiler for the job. Being it three years since I took the class I thought I could brush up on my Ada, Familiarize myself with the ada95 compiler we just put on our network, and get my work done. (kill three birds with one stone) Well this little project is killing three birds and one human. ( I didn't realize what a couple of years can do to one's rememberance of ada) I have gone out on the web searching for some pointers on ada95 b/c I was having some problems. I have this file: With Ada.Text_IO; Use Ada.Text_IO; With Ada.Strings.Unbounded; Use Ada.Strings.Unbounded; Procedure Compare is File1 : File_type; File2 : File_type; FileOut : File_type; File1_line : String(1..80); Begin Open(File1,In_File,"NetView.dat"); Create(FileOut, Out_File, "Data.dat"); While (Not End_Of_File(File1)) loop Get(File1,File1_line); Skip_Line(File1); Put_Line(FileOut,File1_Line); New_Line(FileOut); End Loop; Close(File1); Close(FileOut); End Compare; That I was gonna use to compare two files. I thought I would check it along the way to make sure I was doing things right. I kept getting some errors so as I said I went out onto the web and found some help. One of the AdaPages had this piece of code: with Ada.Strings.Unbounded, Text_IO, Ustrings; use Ada.Strings.Unbounded, Text_IO, Ustrings; procedure Put_Long is -- Print "long" text lines Input : Unbounded_String; begin while (not End_Of_File) loop Get_Line(Input); if Length(Input) > 10 then Put_Line(Input); end if; end loop; end Put_Long; I thought it would be perfect..and looked exactly like what I needed. I couldn't compile it though. It would keep giving me errors saying that I was not passing the right paramters through the Get_line Get_Line(File1,File1_line); I corrected this with a Get Get(File1,File1_line); Now when I get the lines in and write them out from a simple text file. It goes to printing the lines strange into the file almost like item1 blah blah item1 blah blah item1 blah blah item1 blah blah .... This goes on untill it eventually wraps around I have yet to figure out any of these. problems IF some one could let me in on why it is giving me these errors, and evidently tell me what i am forgetting about basic file I/O I would greatly Appreciate it. Sincerely, Robert A. Thompson