comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: STRING length
Date: Wed, 15 Nov 2006 17:28:48 +0100
Date: 2006-11-15T17:28:48+01:00	[thread overview]
Message-ID: <2837620.IpIkgfgtM2@linux1.krischik.com> (raw)
In-Reply-To: 1163544675.070347.64490@h54g2000cwb.googlegroups.com

markww wrote:

> Hi,
> 
> How does one use a variable length string in ada? I created a record
> like:
> 
>     type MY_RECORD is
>       record
>          m_strName     : STRING(1..5);
>          m_strPhone    : STRING(1..5);
>          m_strAddress  : STRING(1..5);
>       end record;
> 
> However when trying to assign the members of the record, at runtime I
> may get an exception if the assigned string is not exactly 5
> characters. Is there a different STRING type which doesn't care how
> long the assigned string is (as long as it's shorter than the max) or
> which just grows to meet the assigned string length?

http://en.wikibooks.org/wiki/Ada_Programming/Strings

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



  parent reply	other threads:[~2006-11-15 16:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 22:51 STRING length markww
2006-11-14 22:24 ` Georg Bauhaus
2006-11-15  0:44   ` markww
2006-11-15  1:09     ` markww
2006-11-15  1:21       ` Ludovic Brenta
2006-11-15  1:29       ` Jeffrey R. Carter
2006-11-15  2:13         ` markww
2006-11-15  1:17     ` Ludovic Brenta
2006-11-15  1:27 ` Jeffrey R. Carter
2006-11-15 16:28 ` Martin Krischik [this message]
2006-11-16  8:25 ` Jerry
  -- strict thread matches above, loose matches on Subject: below --
1998-10-01  0:00 String Length mincus
1998-10-02  0:00 ` Pascal Obry
1998-10-02  0:00   ` Ehud Lamm
replies disabled

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