From: unversedangel@aol.com
Subject: Re: functions, packages & characters
Date: 21 Feb 2002 15:49:46 -0800
Date: 2002-02-21T23:49:48+00:00 [thread overview]
Message-ID: <dcb99faa.0202211549.495dd22e@posting.google.com> (raw)
In-Reply-To: 3C753C66.8020509@mail.com
Hyman Rosen <hyrosen@mail.com> 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;
next prev parent reply other threads:[~2002-02-21 23:49 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-21 8:59 functions, packages & characters Christoph Grein
2002-02-21 18:07 ` Unversed Angel
2002-02-21 18:28 ` Hyman Rosen
2002-02-21 23:44 ` Randy Brukardt
2002-02-22 0:37 ` Matthew Heaney
2002-02-22 1:12 ` Matthew Heaney
2002-02-22 2:57 ` Randy Brukardt
2002-02-22 13:54 ` Marin David Condic
2002-02-23 1:10 ` Matthew Heaney
2002-02-25 15:47 ` Marin David Condic
2002-02-26 15:58 ` Matthew Heaney
2002-02-25 19:37 ` Randy Brukardt
2002-02-25 20:49 ` Marin David Condic
2002-02-26 3:30 ` David Starner
2002-02-26 15:44 ` Hyman Rosen
2002-02-26 21:43 ` David Starner
2002-02-27 6:32 ` Hyman Rosen
2002-02-28 3:55 ` Chad R. Meiners
2002-02-28 18:44 ` Hyman Rosen
2002-03-02 3:25 ` Chad R. Meiners
2002-03-03 8:22 ` Hyman Rosen
2002-03-03 17:50 ` Chad R. Meiners
2002-03-01 2:08 ` David Starner
2002-03-05 14:36 ` Marin David Condic
2002-02-26 7:42 ` tmoran
2002-02-22 15:34 ` Matthew Heaney
2002-02-22 2:47 ` Jeffrey Carter
2002-02-22 13:41 ` Marin David Condic
2002-02-23 1:08 ` Matthew Heaney
2002-02-23 2:03 ` Jeffrey Carter
2002-02-22 16:27 ` Hyman Rosen
2002-02-21 23:49 ` unversedangel [this message]
2002-02-21 22:48 ` unversedangel
2002-02-21 23:14 ` Hyman Rosen
2002-02-22 14:11 ` Marin David Condic
-- strict thread matches above, loose matches on Subject: below --
2002-02-21 0:16 Unversed Angel
2002-02-21 0:37 ` tmoran
2002-02-21 1:13 ` Unversed Angel
2002-02-21 2:53 ` tmoran
2002-02-21 8:25 ` Unversed Angel
2002-02-21 13:47 ` Marin David Condic
2002-02-22 0:22 ` tmoran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox