comp.lang.ada
 help / color / mirror / Atom feed
From: michael@ifr.luftfahrt.uni-stuttgart.de (Michael Paus)
Subject: Re: Help
Date: 1996/11/15
Date: 1996-11-15T00:00:00+00:00	[thread overview]
Message-ID: <56hd39$nu6@info4.rus.uni-stuttgart.de> (raw)
In-Reply-To: 328C2BF5.1348@informatik.tu-muenchen.de


"Alexander B. Schmidt" <schmiale@informatik.tu-muenchen.de> wrote:
> Hi,
> 
> does anybody know how to declare a string of variable length in Ada 
> 83? Declaring a variable of type String like
> str: STRING(1..20);
> and assigning a string like
> str := "a String" 
> results in a constraint error if the length of the string is not equal 
> to 20.
> Is it possible to declare strings with a maximum length which accept 
> the assignment of shorter strings too?

Well, there is nothing like a variable length string in Ada 83 directly.
A string is an array of characters and it does not make much sense to
assign arrays of different sizes to each other. To solve this problem
you can use one of the available string handling packages, or you could
switch from Ada 83 to Ada 95 and use the standard package
Ada.Strings.Unbounded.

(Look at http://www.adahome.com/ to see what is all available for Ada)

Michael

-- 
------------------------------------------------------------------------
--Dipl.-Ing. Michael Paus   (Member: Team Ada)
--University of Stuttgart, Inst. of Flight Mechanics and Flight Control
--Forststrasse 86, 70176 Stuttgart, Germany
--Phone: (+49) 711-121-1434  FAX: (+49) 711-634856
--Email: Michael.Paus@ifr.luftfahrt.uni-stuttgart.de (NeXT-Mail welcome)





  reply	other threads:[~1996-11-15  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-15  0:00 Help Alexander B. Schmidt
1996-11-15  0:00 ` Michael Paus [this message]
1996-11-18  0:00 ` Help Norman H. Cohen
1996-11-19  0:00 ` Help Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
2001-09-19 19:51 help mop
2001-09-20  8:41 ` help John McCabe
1998-12-07  0:00 help Salvador
1998-12-07  0:00 ` help dennison
1997-02-27  0:00 Help Desperate
1997-03-04  0:00 ` Help Jim Dorman
1994-10-19 16:26 HELP CONDIC
1994-10-14  3:33 HELP Chiu Bo (Hung Chiu Hung)
1994-10-14 13:21 ` HELP Robert Dewar
1994-10-15 14:56   ` HELP Bob Duff
1994-10-18 16:31     ` HELP Robert Dewar
1994-10-16  5:11   ` HELP Chiu Bo (Hung Chiu Hung)
1994-10-14 19:36 ` HELP riehler
1994-10-14 19:36 ` HELP Richard Riehle
1994-10-19  3:10 ` HELP Michael M. Bishop
1993-03-12 22:28 Help Basavaraj B Patil
1990-08-01 18:19 Help Kenneth Anderson
replies disabled

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