comp.lang.ada
 help / color / mirror / Atom feed
From: "Beard, Frank" <beardf@spawar.navy.mil>
To: "'comp.lang.ada@ada.eu.org'" <comp.lang.ada@ada.eu.org>
Subject: RE: Strings
Date: Thu, 21 Dec 2000 16:09:47 -0500
Date: 2000-12-21T16:09:47-05:00	[thread overview]
Message-ID: <B6A1A9B09E52D31183ED00A0C9E0888C469976@nctswashxchg.nctswash.navy.mil> (raw)

Jef,

>    I just want a usable string. How would I change the above code to do
> this? And could someone please point me to a site that gives actual,
> concrete examples of simple string use?

While Ada.Strings.Bounded has some useful features, it goes a little beyond
"simple" strings.

Is what you are really looking for:

Option 1)

with Ada.Text_IO;

procedure My_Strings is

    -- Anonymous string fixed at 9 characters
    a1 : string := "Some Text";

begin
    Ada.Text_IO.Put(a1);
    Ada.Text_IO.New_Line;  -- Ada.Text_Io.Put_Line(a1) ~ Put and New_Line.

end My_Strings;


Or Option 2)

with Ada.Text_IO;

procedure My_Strings is

    -- Anonymous string fixed at 80 characters
    a1 : string (1..80) := "Some Text" & (10 .. 80 => ' ');

begin
    Ada.Text_IO.Put_Line(a1);

end My_Strings;

Or Option 3)

with Ada.Text_IO;

procedure My_Strings is

    -- Subtype of string fixed as 80 characters
    subtype Bounded_80 is string (1..80);

    a1 : Bounded_80 := "Some Text" & (10 .. 80 => ' ');

begin
    Ada.Text_IO.Put_Line(a1);

end My_Strings;

Frank





             reply	other threads:[~2000-12-21 21:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-21 21:09 Beard, Frank [this message]
2000-12-22 14:19 ` Strings Jef Kelmo
2000-12-22 14:49   ` Strings Larry Kilgallen
2000-12-22 16:35   ` Strings Marin David Condic
2000-12-23 21:04   ` Strings Georg Bauhaus
  -- strict thread matches above, loose matches on Subject: below --
2000-12-21 17:45 Strings Jef Kelmo
2000-12-21 18:01 ` Strings Jef Kelmo
2000-12-21 18:47 ` Strings mark_lundquist
2000-12-21 18:47 ` Strings mark_lundquist
2000-12-21 23:31   ` Strings gdemont
2000-12-21 19:03 ` Strings David C. Hoos, Sr.
2000-05-27  0:00 Strings Karlene
2000-05-27  0:00 ` Strings David C. Hoos, Sr.
2000-05-27  0:00 ` Strings Robert Dewar
2000-05-27  0:00 ` Strings Robert Dewar
2000-05-27  0:00 ` Strings MaggieJohn
2000-05-28  0:00   ` Strings Robert Dewar
2000-06-03  0:00     ` Strings Robert I. Eachus
1995-01-25 15:08 Strings Ray Toal
replies disabled

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