comp.lang.ada
 help / color / mirror / Atom feed
From: bill@nospam.com
Subject: Re: array question
Date: 1999/01/18
Date: 1999-01-18T00:00:00+00:00	[thread overview]
Message-ID: <7819qk$cbj@drn.newsguy.com> (raw)
In-Reply-To: 78189o$2bj@eng-ser1.erg.cuhk.edu.hk

In article <78189o$2bj@eng-ser1.erg.cuhk.edu.hk>, ycli6@se.cuhk.edu.hk says...
 
>	i want to ask a question in array.
>type MY_ARRAY is array(INTEGER range <>) of FLOAT;
>
>what is the meaning of <>, also can i replace INTEGER with
>other type? such as FLOAT, BOOLEAN?
>

<> means the range is undertmined at type declaration time.
when you then define a variable this type, then you need to specify
the range. This way you can use the same type to define different
objects of that type of varying ranges. so you dont have to have
to declare a new type everytime where is the only difference
between them is the value of the range. this is called generic type.

yes, you can change INTEGER above. this is the type of the index. which
can be any scalar type.

check some of the Ada text books for examples.

bill
 




  reply	other threads:[~1999-01-18  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-19  0:00 array question yukchi
1999-01-18  0:00 ` bill [this message]
1999-01-19  0:00   ` David C. Hoos, Sr.
1999-01-19  0:00 ` Tom Moran
1999-01-19  0:00 ` Matthew Heaney
1999-01-23  0:00 ` Bryan Shayne
  -- strict thread matches above, loose matches on Subject: below --
2014-02-10  3:49 agent
2014-02-10  5:39 ` Jeffrey Carter
2014-02-10 12:41   ` agent
2014-02-10 13:40 ` Mike H
2014-02-10 15:13   ` Mike H
2014-02-10 16:41     ` Robert A Duff
2014-02-10 17:02       ` Mike H
2014-02-11 22:25       ` agent
2014-02-12 16:48         ` Mike H
2014-02-11  1:47     ` Dennis Lee Bieber
2014-02-11 14:22       ` Mike H
replies disabled

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