comp.lang.ada
 help / color / mirror / Atom feed
* Strings
@ 1995-01-25 15:08 Ray Toal
  0 siblings, 0 replies; 19+ messages in thread
From: Ray Toal @ 1995-01-25 15:08 UTC (permalink / raw)


I was impressed by Robert Firth's note in response to the claim made
by a previous poster who claimed

  *p++ = *q++

is more readable than

  loop
    P(I_ := Q(I);
    I := I + 1;
    ...

Rober said a real Ada programmer would write

  P := Q;

True! Touche!  Ada is more terse and more readable than C on this one!

To be fair to the C folks, C++ now features a "language-defined"
string class, so one string can be assigned to another with "=":

  s1 = s2;

My concern is with many in the C "culture" who would probably avoid
the use of this class and stick with "char*"s, on account of some
probable (real or imagined) loss of efficiency.  The vastly improved
clarity of program text that deals with complex objects as single
entities (as opposed to constantly fiddling with their internals)
is a strong point of Ada and a reason why Ada programs are more
readable and far less error prone.

At least the C++ "committee" is realizing this.  Perhaps some day
we can look forward to a **real** array class.  But of course, in C++,
if you WANT safe arrays or safe pointers, you can always code them
yourself.

My preference is to have safety by default, as in Ada, and be specific
when I need Unchecked things.

Ray Toal




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-05-27  0:00 Strings Karlene
                   ` (2 preceding siblings ...)
  2000-05-27  0:00 ` Strings Robert Dewar
@ 2000-05-27  0:00 ` David C. Hoos, Sr.
  3 siblings, 0 replies; 19+ messages in thread
From: David C. Hoos, Sr. @ 2000-05-27  0:00 UTC (permalink / raw)



Karlene <kejohnso@student.ecu.edu.au> wrote in message
news:8gntbr$mei$2@news.cowan.edu.au...
> How can you validate a string (eg a name of a person) to check that it
only
> contains characters, not integers?  I have tried exceptions in my program,
> but it dosent seem to cover it.
>
Look at the character classification functions in the package
Ada.Characters.Handling.







^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-05-27  0:00 Strings Karlene
@ 2000-05-27  0:00 ` MaggieJohn
  2000-05-28  0:00   ` Strings Robert Dewar
  2000-05-27  0:00 ` Strings Robert Dewar
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 19+ messages in thread
From: MaggieJohn @ 2000-05-27  0:00 UTC (permalink / raw)


Loop through your string and check that each character is between 'a' and 'z'
or 'A' and 'Z'.   Are you familiar with ASCII codes?   Your string is made up
of ASCII codes.   Some are for letters, which sounds like what you want.   Some
are for numbers, punctuation, and some are non-printable control characters.

- Maggie

"Karlene" asked:
How can you validate a string (eg a name of a person) to check that it only
contains characters, not integers?  I have tried exceptions in my program,
but it dosent seem to cover it.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Strings
@ 2000-05-27  0:00 Karlene
  2000-05-27  0:00 ` Strings MaggieJohn
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Karlene @ 2000-05-27  0:00 UTC (permalink / raw)


How can you validate a string (eg a name of a person) to check that it only
contains characters, not integers?  I have tried exceptions in my program,
but it dosent seem to cover it.






^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-05-27  0:00 Strings Karlene
  2000-05-27  0:00 ` Strings MaggieJohn
  2000-05-27  0:00 ` Strings Robert Dewar
@ 2000-05-27  0:00 ` Robert Dewar
  2000-05-27  0:00 ` Strings David C. Hoos, Sr.
  3 siblings, 0 replies; 19+ messages in thread
From: Robert Dewar @ 2000-05-27  0:00 UTC (permalink / raw)


In article <8gntbr$mei$2@news.cowan.edu.au>,
  "Karlene" <kejohnso@student.ecu.edu.au> wrote:
> How can you validate a string (eg a name of a person) to check
that it only
> contains characters, not integers?  I have tried exceptions in
my program,
> but it dosent seem to cover it.


A string can never contain integers, so this question is
completely meaningless. I would suspect it is really a
simple question about the logic of your assignment, something
you need to figure out, rather than a language question.


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-05-27  0:00 Strings Karlene
  2000-05-27  0:00 ` Strings MaggieJohn
@ 2000-05-27  0:00 ` Robert Dewar
  2000-05-27  0:00 ` Strings Robert Dewar
  2000-05-27  0:00 ` Strings David C. Hoos, Sr.
  3 siblings, 0 replies; 19+ messages in thread
From: Robert Dewar @ 2000-05-27  0:00 UTC (permalink / raw)


In article <8gntbr$mei$2@news.cowan.edu.au>,
  "Karlene" <kejohnso@student.ecu.edu.au> wrote:
> How can you validate a string (eg a name of a person) to check
that it only
> contains characters, not integers?  I have tried exceptions in
my program,
> but it dosent seem to cover it.


To be a little clearer, a string is defined to be a sequence
of characters, so every element of a string is a character.
So the idera of checking to see if a string contains only
characters is meaningless. If you are asking how to
distinguish digits from letters, then that is done by
simple tests, and you really should be able to figure this
out for yourself.

Exceptions are most certainly irrelevant. I suspect you are
flailing around at random here, you really need to make more
of an effort to understand what you are doing. I would suggest
working your way carefully and completely through one of the
online tutorials at www.adapower.com, or really reading through
your text book carefully.

You may be able to bash a small program into working without
understanding what you are doing, but this definitely will
not scale to real programs!


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-05-27  0:00 ` Strings MaggieJohn
@ 2000-05-28  0:00   ` Robert Dewar
  2000-06-03  0:00     ` Strings Robert I. Eachus
  0 siblings, 1 reply; 19+ messages in thread
From: Robert Dewar @ 2000-05-28  0:00 UTC (permalink / raw)


In article <20000527160256.22891.00000308@ng-fw1.aol.com>,
  maggiejohn@aol.com (MaggieJohn) wrote:
> Loop through your string and check that each character is
>between 'a' and 'z'
> or 'A' and 'Z'.   Are you familiar with ASCII codes?   Your
> string is made up
> of ASCII codes.   Some are for letters, which sounds like what
>you want.   Some
> are for numbers, punctuation, and some are non-printable
          ^^^^^^^

you mean digits!

>control characters.

Actually David's advice was more useful. All letters are not
in the range 'a' to 'z' unless you have a very english-centered
view of the world :-)


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-05-28  0:00   ` Strings Robert Dewar
@ 2000-06-03  0:00     ` Robert I. Eachus
  0 siblings, 0 replies; 19+ messages in thread
From: Robert I. Eachus @ 2000-06-03  0:00 UTC (permalink / raw)


Robert Dewar wrote:

> Actually David's advice was more useful. All letters are not
> in the range 'a' to 'z' unless you have a very english-centered
> view of the world :-)

   I agree with the message, but not with the wording.  The English
language uses many more characters than the twenty-six of the English
alphabet.  In fact a "standard" type drawer contains many characters
and digraphs used in normal English but not found in Latin-1! (Some of
these are digraphs, such as fl, ffl, fi, and ffi.  But others include
the ae with diaresis found in encyclopaedia, the oe digraph, and the
worst case--a town where the name begins with the Oe diaresis digraph,
and only the O is capitalized. ;-)




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Strings
@ 2000-12-21 17:45 Jef Kelmo
  2000-12-21 18:01 ` Strings Jef Kelmo
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Jef Kelmo @ 2000-12-21 17:45 UTC (permalink / raw)


Hello,

    This is not a homework question. In 5 months, I will begin work that
uses Ada and am trying to become familiar with it now. But I am having a
problem with how to use strings; a problem that seems common across a
number of languages, including C++ and Java.

    I entered the following...

----------------------------------------------------------------------------------------------------------

with Ada.Text_IO;
with Ada.Strings.Bounded;

procedure My_Strings is
    type Bounded_80 is new
Ada.Strings.Bounded.Generic_Bounded_Length(80);

    a1 : Bounded_80.Bounded_String := Bounded_80.To_Bounded_String("Some
Text");

begin
    Ada.Text_IO.Put(Bounded_80.To_String(a1));
    Ada.Text_IO.New_Line;

end My_Strings;
----------------------------------------------------------------------------------------------------------

 ...and when I compile, I get the following...

gcc -c my_strings.adb
my_strings.adb:5:47: subtype mark required in this context
my_strings.adb:5:70: incorrect constraint for this kind of type
my_strings.adb:7:10: invalid prefix in selected component "Bounded_80"
my_strings.adb:7:39: invalid prefix in selected component "Bounded_80"
my_strings.adb:12:21: invalid prefix in selected component "Bounded_80"
gnatmake: "my_strings.adb" compilation error


    So my first guess is to change...

    type Bounded_80 is new
Ada.Strings.Bounded.Generic_Bounded_Length(80);

    ...to...

    subtype Bounded_80 is new
Ada.Strings.Bounded.Generic_Bounded_Length(80);

    ...in which case I get...

gcc -c my_strings.adb
my_strings.adb:5:27: "new" ignored (only allowed in type declaration)
gnatmake: "my_strings.adb" compilation error

    ...so I remove the "new" and get...

gcc -c my_strings.adb
my_strings.adb:5:46: subtype mark required in this context
my_strings.adb:5:69: incorrect constraint for this kind of type
my_strings.adb:7:10: invalid prefix in selected component "Bounded_80"
my_strings.adb:7:39: invalid prefix in selected component "Bounded_80"
my_strings.adb:12:21: invalid prefix in selected component "Bounded_80"
gnatmake: "my_strings.adb" compilation error

    Is it obvious by now that I don't know what I am doing? I have a
copy of Ada as a 2d Language and I looked up the Ada Reference on
adapower.com, but everything is too vague and anything I try does not
work.

    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?

    Thanks.

James





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-12-21 17:45 Strings Jef Kelmo
@ 2000-12-21 18:01 ` Jef Kelmo
  2000-12-21 18:47 ` Strings mark_lundquist
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Jef Kelmo @ 2000-12-21 18:01 UTC (permalink / raw)


Whoanelliethereboy!

    Okay, I just stumbled across the adapower FAQs. Sorry about clogging the system.  But if anyone has any
advice, please feel free.

    Thanks.

James

I wrote:

> Hello,




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-12-21 17:45 Strings Jef Kelmo
  2000-12-21 18:01 ` Strings Jef Kelmo
@ 2000-12-21 18:47 ` mark_lundquist
  2000-12-21 18:47 ` Strings mark_lundquist
  2000-12-21 19:03 ` Strings David C. Hoos, Sr.
  3 siblings, 0 replies; 19+ messages in thread
From: mark_lundquist @ 2000-12-21 18:47 UTC (permalink / raw)


In article <3A42418F.ACCD532A@vdu.org>,
  Jef Kelmo <jlk@vdu.org> wrote:
>
>     Is it obvious by now that I don't know what I am doing?

yeh... :-) :-) :-)

Your problem is simple...

When you instantiate a generic package, you get a package, but you're
trying to call it a type.

Instantiate the generic, then use the type from the instance, something
like:

    package Bounded_Strings_80 is
        new Ada.Strings.Bounded.Generic_Bounded_Length(80);

    subtype String_80 is Bounded_Strings_80.Bounded_String;


Good luck with Ada!
-- mark

Mark Lundquist
Rational Software



Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  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 ` mark_lundquist
  2000-12-21 23:31   ` Strings gdemont
  2000-12-21 19:03 ` Strings David C. Hoos, Sr.
  3 siblings, 1 reply; 19+ messages in thread
From: mark_lundquist @ 2000-12-21 18:47 UTC (permalink / raw)


In article <3A42418F.ACCD532A@vdu.org>,
  Jef Kelmo <jlk@vdu.org> wrote:
>
>     Is it obvious by now that I don't know what I am doing?

yeh... :-) :-) :-)

Your problem is simple...

When you instantiate a generic package, you get a package, but you're
trying to call it a type.

Instantiate the generic, then use the type from the instance, something
like:

    package Bounded_Strings_80 is
        new Ada.Strings.Bounded.Generic_Bounded_Length(80);

    subtype String_80 is Bounded_Strings_80.Bounded_String;


Good luck with Ada!
-- mark

Mark Lundquist
Rational Software



Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-12-21 17:45 Strings Jef Kelmo
                   ` (2 preceding siblings ...)
  2000-12-21 18:47 ` Strings mark_lundquist
@ 2000-12-21 19:03 ` David C. Hoos, Sr.
  3 siblings, 0 replies; 19+ messages in thread
From: David C. Hoos, Sr. @ 2000-12-21 19:03 UTC (permalink / raw)


Your problem is that Ada.Strings.Bounded.Generic_Bounded_Length
is a generic _package_, not a type.

An instantiation of that _package_ exports a type Bounded_String.

So, if in your original example, you substitute
package Bounded_80 is new ...
for type Bounded_80 is new ...
everything will work as expected.


"Jef Kelmo" <jlk@vdu.org> wrote in message news:3A42418F.ACCD532A@vdu.org...
> Hello,
>
>     This is not a homework question. In 5 months, I will begin work that
> uses Ada and am trying to become familiar with it now. But I am having a
> problem with how to use strings; a problem that seems common across a
> number of languages, including C++ and Java.
>
>     I entered the following...
>
> --------------------------------------------------------------------------
--------------------------------
>
> with Ada.Text_IO;
> with Ada.Strings.Bounded;
>
> procedure My_Strings is
>     type Bounded_80 is new
> Ada.Strings.Bounded.Generic_Bounded_Length(80);
>
>     a1 : Bounded_80.Bounded_String := Bounded_80.To_Bounded_String("Some
> Text");
>
> begin
>     Ada.Text_IO.Put(Bounded_80.To_String(a1));
>     Ada.Text_IO.New_Line;
>
> end My_Strings;
> --------------------------------------------------------------------------
--------------------------------
>
>  ...and when I compile, I get the following...
>
> gcc -c my_strings.adb
> my_strings.adb:5:47: subtype mark required in this context
> my_strings.adb:5:70: incorrect constraint for this kind of type
> my_strings.adb:7:10: invalid prefix in selected component "Bounded_80"
> my_strings.adb:7:39: invalid prefix in selected component "Bounded_80"
> my_strings.adb:12:21: invalid prefix in selected component "Bounded_80"
> gnatmake: "my_strings.adb" compilation error
>
>
>     So my first guess is to change...
>
>     type Bounded_80 is new
> Ada.Strings.Bounded.Generic_Bounded_Length(80);
>
>     ...to...
>
>     subtype Bounded_80 is new
> Ada.Strings.Bounded.Generic_Bounded_Length(80);
>
>     ...in which case I get...
>
> gcc -c my_strings.adb
> my_strings.adb:5:27: "new" ignored (only allowed in type declaration)
> gnatmake: "my_strings.adb" compilation error
>
>     ...so I remove the "new" and get...
>
> gcc -c my_strings.adb
> my_strings.adb:5:46: subtype mark required in this context
> my_strings.adb:5:69: incorrect constraint for this kind of type
> my_strings.adb:7:10: invalid prefix in selected component "Bounded_80"
> my_strings.adb:7:39: invalid prefix in selected component "Bounded_80"
> my_strings.adb:12:21: invalid prefix in selected component "Bounded_80"
> gnatmake: "my_strings.adb" compilation error
>
>     Is it obvious by now that I don't know what I am doing? I have a
> copy of Ada as a 2d Language and I looked up the Ada Reference on
> adapower.com, but everything is too vague and anything I try does not
> work.
>
>     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?
>
>     Thanks.
>
> James
>
>





^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: Strings
@ 2000-12-21 21:09 Beard, Frank
  2000-12-22 14:19 ` Strings Jef Kelmo
  0 siblings, 1 reply; 19+ messages in thread
From: Beard, Frank @ 2000-12-21 21:09 UTC (permalink / raw)
  To: 'comp.lang.ada@ada.eu.org'

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





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-12-21 18:47 ` Strings mark_lundquist
@ 2000-12-21 23:31   ` gdemont
  0 siblings, 0 replies; 19+ messages in thread
From: gdemont @ 2000-12-21 23:31 UTC (permalink / raw)


mark_lundquist@my-deja.com:

>     package Bounded_Strings_80 is
>         new Ada.Strings.Bounded.Generic_Bounded_Length(80);
>
>     subtype String_80 is Bounded_Strings_80.Bounded_String;
>
> Good luck with Ada!

BTW, you can do bounded strings in Ada just as simple as
Borland Pascal or Delphi:

with & use BorStrings package (paqs.zip @ url below);

...

s100: BorString(100); -- max length for this is 100

etc.

G.

Maybe the future Ada.Strings.Easy_Bounded (Ada 0x) ;-)

http://members.nbci.com/_XMCM/gdemont/gsoft.htm



Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-12-21 21:09 Strings Beard, Frank
@ 2000-12-22 14:19 ` Jef Kelmo
  2000-12-22 14:49   ` Strings Larry Kilgallen
                     ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Jef Kelmo @ 2000-12-22 14:19 UTC (permalink / raw)


Hello,

    What I want is to figure how to get something like the C++ strings class,
where I can have strings of various sizes, eventually building an array of
strings. But I'm having trouble with a simple string itself. In C++, you have
the string.length which goes to the null character, but from what I can
figure, there is not the same thing in Ada. Is this true?

    Anyway, what I would like, as I mentioned, is to be able to create an
array of strings that I can feed, after its creation, with data and be able to
spit it back out to the screen with some simple way for it to understand the
length of each string. I found the Get_Line(Input, String, Last) thing, but do
I really have to keep track of that length for hundreds of strings?

    Thanks.

Jef

"Beard, Frank" wrote:

> 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.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-12-22 14:19 ` Strings Jef Kelmo
@ 2000-12-22 14:49   ` Larry Kilgallen
  2000-12-22 16:35   ` Strings Marin David Condic
  2000-12-23 21:04   ` Strings Georg Bauhaus
  2 siblings, 0 replies; 19+ messages in thread
From: Larry Kilgallen @ 2000-12-22 14:49 UTC (permalink / raw)


So what did you find wrong with Bounded Strings in Ada95 ?

In article <3A4362BD.8E156868@vdu.org>, Jef Kelmo <jlk@vdu.org> writes:
> Hello,
> 
>     What I want is to figure how to get something like the C++ strings class,
> where I can have strings of various sizes, eventually building an array of
> strings. But I'm having trouble with a simple string itself. In C++, you have
> the string.length which goes to the null character, but from what I can
> figure, there is not the same thing in Ada. Is this true?
> 
>     Anyway, what I would like, as I mentioned, is to be able to create an
> array of strings that I can feed, after its creation, with data and be able to
> spit it back out to the screen with some simple way for it to understand the
> length of each string. I found the Get_Line(Input, String, Last) thing, but do
> I really have to keep track of that length for hundreds of strings?
> 
>     Thanks.
> 
> Jef
> 
> "Beard, Frank" wrote:
> 
>> 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.
> 
-- 
==============================================================================
Great Inventors of our time: Al Gore -> Internet; Sun Microsystems -> Clusters
==============================================================================



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  2000-12-22 14:19 ` Strings Jef Kelmo
  2000-12-22 14:49   ` Strings Larry Kilgallen
@ 2000-12-22 16:35   ` Marin David Condic
  2000-12-23 21:04   ` Strings Georg Bauhaus
  2 siblings, 0 replies; 19+ messages in thread
From: Marin David Condic @ 2000-12-22 16:35 UTC (permalink / raw)


You'll want to investigate Ada.Strings.Unbounded. This lets you declare strings
that are fully dynamic and can shrink/grow as you need it. It is not as efficient
as Ada.Strings.Bounded (static allocation of a maximum size) or the plain vanilla
type String, but unless you're operating in real time, this probably won't matter
much.

In Ada83, strings were essentially like C strings - a static array of characters.
There weren't many utility routines to deal with them except the home grown
variety. Ada95 retained this String type, but extended it to give you more choices
about how to handle things and more utilities to do work for you. Most of the
language still has parameters that require a String type, but it's simple enough
to convert as you need to.

My typical strategy is to read in whatever string data I need (using Text_IO or
whatever else makes sense) and immediately convert to Unbounded_String for
internal use. When it has to go out again, you just use the To_String function to
get the data back to the correct data type for output. Once you get used to the
subprograms and types involved, it isn't very hard at all.

MDC

Jef Kelmo wrote:

> Hello,
>
>     What I want is to figure how to get something like the C++ strings class,
> where I can have strings of various sizes, eventually building an array of
> strings. But I'm having trouble with a simple string itself. In C++, you have
> the string.length which goes to the null character, but from what I can
> figure, there is not the same thing in Ada. Is this true?
>
>     Anyway, what I would like, as I mentioned, is to be able to create an
> array of strings that I can feed, after its creation, with data and be able to
> spit it back out to the screen with some simple way for it to understand the
> length of each string. I found the Get_Line(Input, String, Last) thing, but do
> I really have to keep track of that length for hundreds of strings?
>
>     Thanks.
>
> Jef
>
> "Beard, Frank" wrote:
>
> > 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.

--
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at:  http://www.mcondic.com/

    "Giving money and power to Government is like giving whiskey
    and car keys to teenage boys."

        --   P. J. O'Rourke
======================================================================





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Strings
  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   ` Georg Bauhaus
  2 siblings, 0 replies; 19+ messages in thread
From: Georg Bauhaus @ 2000-12-23 21:04 UTC (permalink / raw)


Jef Kelmo (jlk@vdu.org) wrote:
: length of each string. I found the Get_Line(Input, String, Last) thing, but do
: I really have to keep track of that length for hundreds of strings?

No, they do this themselves, look up the 'Length attribute.
You can also declare an access type to String, allowing you
to create new Strings  (of varying length) and having the
entries in your table point to the creations.



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2000-12-23 21:04 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-27  0:00 Strings Karlene
2000-05-27  0:00 ` Strings MaggieJohn
2000-05-28  0:00   ` Strings Robert Dewar
2000-06-03  0:00     ` Strings Robert I. Eachus
2000-05-27  0:00 ` Strings Robert Dewar
2000-05-27  0:00 ` Strings Robert Dewar
2000-05-27  0:00 ` Strings David C. Hoos, Sr.
  -- strict thread matches above, loose matches on Subject: below --
2000-12-21 21:09 Strings Beard, Frank
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
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.
1995-01-25 15:08 Strings Ray Toal

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