comp.lang.ada
 help / color / mirror / Atom feed
* STRING length
@ 2006-11-14 22:51 markww
  2006-11-14 22:24 ` Georg Bauhaus
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: markww @ 2006-11-14 22:51 UTC (permalink / raw)


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?

Thanks




^ permalink raw reply	[flat|nested] 14+ messages in thread
* String Length
@ 1998-10-01  0:00 mincus
  1998-10-02  0:00 ` Pascal Obry
  0 siblings, 1 reply; 14+ messages in thread
From: mincus @ 1998-10-01  0:00 UTC (permalink / raw)


If anyone knows how to determine the size of a string I would be very
grateful.

I thought that I could do a

string'last

and that would return the position of the last char, but I just get an
error, please help

mincus






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

end of thread, other threads:[~2006-11-16  8:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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