comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <martin@krischik.com>
Subject: Re: Access types to records containing strings
Date: Sat, 29 Jan 2005 10:32:54 +0100
Date: 2005-01-29T10:32:54+01:00	[thread overview]
Message-ID: <1106992806.14d0bea32f92e07d32ea0c5289cc6693@teranews> (raw)
In-Reply-To: 3611gpF4qnb9hU1@individual.net

Stefan Merwitz wrote:

> Hello everybody,
> 
> it's me again. I need to implement a list containing strings using
> access types. Is there a way to implement this using variable length
> strings:
> 
> private type list;
> private type listobject is record
>      sContent: string(1..30);
>      Next := list;
> end record;
> private type list is access listobject;
> 
> With the knowledge I have till now, I think it's only possible with
> fixed length strings.

Then you have not got very far in your textbook or lessons ;-) .

> Am I right or is there any other way? 

Two options are open:

1) Discriminanted_Record
   http://en.wikibooks.org/wiki/Programming:Ada:Types:record#Discriminanted_Record

2) Unbounded_Strings
   http://www.adaic.org/standards/95lrm/html/RM-A-4-5.html

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com



  reply	other threads:[~2005-01-29  9:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-29  8:58 Access types to records containing strings Stefan Merwitz
2005-01-29  9:32 ` Martin Krischik [this message]
2005-01-29 10:03 ` Dmitry A. Kazakov
2005-02-15 12:17   ` Xavier Serrand
2005-02-15 13:20     ` Dmitry A. Kazakov
2005-02-15 16:18       ` Matthew Heaney
replies disabled

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