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 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-26 18:45:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!wn3feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc01.POSTED!not-for-mail From: Wannabe h4x0r Subject: Re: reading from a file Newsgroups: comp.lang.ada References: User-Agent: Pan/0.11.1 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: "Deepie" Message-ID: NNTP-Posting-Host: 12.245.48.122 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc01 1014777956 12.245.48.122 (Wed, 27 Feb 2002 02:45:56 GMT) NNTP-Posting-Date: Wed, 27 Feb 2002 02:45:56 GMT Organization: AT&T Broadband Date: Wed, 27 Feb 2002 02:45:57 GMT Xref: archiver1.google.com comp.lang.ada:20493 Date: 2002-02-27T02:45:57+00:00 List-Id: 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