comp.lang.ada
 help / color / mirror / Atom feed
From: Wannabe h4x0r <chris@dont.spam.me>
Subject: String slicing.
Date: Sun, 17 Mar 2002 22:23:28 GMT
Date: 2002-03-17T22:23:28+00:00	[thread overview]
Message-ID: <AH8l8.64181$uA5.64687@rwcrnsc51.ops.asp.att.net> (raw)

I've written a type definition as follows...

	type wrd_string is new String(1..Ada.Characters.Latin_1.Space);

Now it says that I'm using incompatible types. Now, shouldn't the
compiler be smart enough to recognize that I'm using Characters to count
the characters of an array slice. i.e. a String is nothing more than an
array of characters.

Basically I'm breaking down a text file into chunks of "words" and
"sentences" for sorting by Mats Webers "quick_sort" routine in his
components library. Or rather, I'm learning how to. I can sort by
character easily enough, now I'm learning to work with slices of Strings.

This is a general pain in the ass for me, as it seems Ada wont let me
slice and reference pieces of strings using Characters. Dont worry, I am
reading the manual. Any tips or pointers would be helpful.

Chris



             reply	other threads:[~2002-03-17 22:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-17 22:23 Wannabe h4x0r [this message]
2002-03-17 22:43 ` String slicing Jim Rogers
2002-03-17 23:53   ` Wannabe h4x0r
2002-03-18 12:44 ` sk
2002-03-19  2:36   ` Wannabe h4x0r
2002-03-18 17:49 ` Georg Bauhaus
replies disabled

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