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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,794c64d1f9164710 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-21 15:49:48 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: unversedangel@aol.com Newsgroups: comp.lang.ada Subject: Re: functions, packages & characters Date: 21 Feb 2002 15:49:46 -0800 Organization: http://groups.google.com/ Message-ID: References: <20020221130715.12738.00000034@mb-bg.aol.com> <3C753C66.8020509@mail.com> NNTP-Posting-Host: 64.12.102.39 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1014335388 7707 127.0.0.1 (21 Feb 2002 23:49:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 21 Feb 2002 23:49:48 GMT Xref: archiver1.google.com comp.lang.ada:20233 Date: 2002-02-21T23:49:48+00:00 List-Id: Hyman Rosen wrote in message news:<3C753C66.8020509@mail.com>... > Unversed Angel wrote: > > Line_Buffer : String (1 .. 1000); > Unless you have very domain-specific information, > using a fixed-size input buffer is an invitation > to errors. You will never pick a large-enough size. I had already realised that unbounded_strings were the best way to go but i have no idea what to do next as this program will not compile. with Text_io; use Text_io; procedure main is ---pre: text is in the mark up language ---post: text has been converted to english ---test: once thru procedure Get_line is ---pre:text needs to be input ---post:text has been input ---test: once thru Line_Buffer : String(Unbounded_String); Line_Length : Natural range 0 .. Line_Buffer'Last; Line_Store : array (1 .. 10_000) of Unbounded_String; Line_Count : Natural range 0 .. Line_Store'Last; begin loop Get_Line (Line_Buffer, Line_Length); Line_Count := Line_Count + 1; Line_Store (Line_Count) := To_Unbounded_String (Line_Buffer (1 .. Line_Length)); new_line; end loop; end; Procedure doubleslash is ---pre:mark up language has been input ---post:doubleslash has been converted to single slash ---test: /,//,/// begin Loop For i in s'range loop if s(i)="//" then s:='/'; end if; end loop; end; procedure unformatted is ---pre: mark up language has been input ---post:/N tag has left the text formatted as it was ---test: /N, /N/N,/N/U Loop For i in s'range loop if s(i)=/N then do nothing elseif exit end if; end if; end_loop; End; Begin --of main s:string; Put("Please enter text: "); Get_Line(s); doubleslash; unformatted; end;