comp.lang.ada
 help / color / mirror / Atom feed
From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Subject: Re: how to reverse output of a line using ada
Date: 2000/11/21
Date: 2000-11-21T18:26:33+00:00	[thread overview]
Message-ID: <8veeop$acb$1@drcomp.erfurt.thur.de> (raw)
In-Reply-To: 8ve870$4fkkm$1@ID-62217.news.dfncis.de

Florian Paulus <mailme@ascat.de> wrote:

> Hi everybody!

Hi!

> my program shall read a line and display it reversed.

I'd do it this way:

with ustrings; use ustrings;
with ada.strings.unbounded; use ada.strings.unbounded;
with ada.text_IO; use ada.text_IO;

procedure bla is

        procedure output(what : in String) is
        begin
                for I in reverse what'range loop
                        Put(what(I));
                end loop;
        end output;

  buffer : ustring;

begin
        Get_Line(buffer);
        output(To_String(buffer));
end bla;


Please discuss.


-- 
mail: adi@thur.de	web: adi.thur.de	PGP: v2-key via keyserver

Q:Kann mir jemand helfen ? A: Du benutzt NT, Dir kann Keiner mehr helfen.




  reply	other threads:[~2000-11-21  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-21  0:00 how to reverse output of a line using ada Florian Paulus
2000-11-21  0:00 ` Adrian Knoth [this message]
2000-11-21  0:00 ` mjsilva
2000-11-21  0:00 ` Ted Dennison
2000-11-22  0:00 ` Paul Cass
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox