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=-1.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b3b93af4cfcf5a32 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-28 09:24:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!btnet-peer1!btnet-peer0!btnet!newsr2.u-net.net!peernews!peer.cwci.net!news5-gui.server.ntli.net!ntli.net!news6-win.server.ntlworld.com.POSTED!not-for-mail From: "Deepie" Newsgroups: comp.lang.ada References: Subject: Re: reading from a file X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: Date: Thu, 28 Feb 2002 17:25:15 -0000 NNTP-Posting-Host: 62.255.149.243 X-Complaints-To: abuse@ntlworld.com X-Trace: news6-win.server.ntlworld.com 1014917090 62.255.149.243 (Thu, 28 Feb 2002 17:24:50 GMT) NNTP-Posting-Date: Thu, 28 Feb 2002 17:24:50 GMT Organization: ntl Cablemodem News Service X-Received-Date: Thu, 28 Feb 2002 17:24:51 GMT (newsr2.u-net.net) Xref: archiver1.google.com comp.lang.ada:20580 Date: 2002-02-28T17:25:15+00:00 List-Id: ok, cheers guys :P Deepie "Wannabe h4x0r" wrote in message news:ELXe8.11783$bs1.241207@sccrnsc01... > On Mon, 25 Feb 2002 12:08:01 -0500, Deepie wrote: > > > Hi, > > > > I am currently writing a program from which i need to read in from a > > file. > > > > When trying to read from the file using a command such as Skip_Line(F), > > F being the file handle, i generate an 'invalid parameter in use' error. > > > > things like Get_Line(F, name, length) dont work either. am i missing > > something here? > > > > TIA > > > > deepie > > You know there are simpler ways to do it. Heres how I do it... > > with Ada.Text_IO; use Ada.Text_IO; > > TEXT : string(1..N); > Length : Natural; > File : File_type; > > Open(File, IN_FILE, TEXT(1..Length)); > > MAIN: > get_line(FILE, TEXT, LENGTH); > put_line(TEXT(1..LENGTH)); -- You can split up and rearrange this stuff > in any number of ways. -- > blah blah blah.... > > You get the picture. Sequential IO, when not necessary, is just a hassle. > > > Chris