comp.lang.ada
 help / color / mirror / Atom feed
From: "jimmaureenrogers@worldnet.att.net" <jimmaureenrogers@worldnet.att.net>
Subject: Re: Strings and errors... (gnat)
Date: 29 Nov 2006 18:04:37 -0800
Date: 2006-11-29T18:04:37-08:00	[thread overview]
Message-ID: <1164852277.688085.175850@l12g2000cwl.googlegroups.com> (raw)
In-Reply-To: wccmz6aywo5.fsf@shell01.TheWorld.com

Robert A Duff wrote:
> You can't assign a shorter string into a longer one -- the lengths have
> to match.

However, you can use the predefined package Ada.Strings.Fixed to
move the shorter string into the longer string.

The Ada Reference Manual describes the move procedure as:

procedure Move (Source : in String;
Target : out String;
Drop : in Truncation := Error;
Justify : in Alignment := Left;
Pad : in Character := Space);

Note that the package Ada.Strings is defined as:

package Ada.Strings is
pragma Pure(Strings);

Space : constant Character := ' ';
Wide_Space : constant Wide_Character := ' ';

Length_Error, Pattern_Error, Index_Error, Translation_Error :
exception;

type Alignment is (Left, Right, Center);
type Truncation is (Left, Right, Error);
type Membership is (Inside, Outside);
type Direction is (Forward, Backward);
type Trim_End is (Left, Right, Both); 
end Ada.Strings; 


Jim Rogers




  parent reply	other threads:[~2006-11-30  2:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29 17:30 Strings and errors... (gnat) tr00per
2006-11-29 17:44 ` Robert A Duff
2006-11-29 17:57   ` tr00per
2006-11-29 18:10     ` Ludovic Brenta
2006-11-30 11:36       ` Georg Bauhaus
2006-11-30  2:04   ` jimmaureenrogers [this message]
2006-12-01  8:39 ` Martin Krischik
2006-12-01 19:39   ` [solved] tr00per
  -- strict thread matches above, loose matches on Subject: below --
2006-11-29 17:57 Strings and errors... (gnat) Benjamin Place
2006-11-30  6:16 ` Jeffrey R. Carter
replies disabled

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