comp.lang.ada
 help / color / mirror / Atom feed
From: Mario Amado Alves <maa@di.fct.unl.pt>
To: comp.lang.ada@ada.eu.org
Subject: array(enumeration)
Date: 2000/07/19
Date: 2000-07-20T12:16:08+00:00	[thread overview]
Message-ID: <Pine.LNX.4.10.10007191643160.863-100000@lexis.di.fct.unl.pt> (raw)

How do I define an array type indexed by an enumeration type?

  type Array_Type is array(<>) of Some_Type;
    --                    /|\
    --                     |
    -- compiler says identifier expected here

  type Enumeration_Type is (A, B, C);
  type Another_Enumeration_Type is (X, Y, Z);

  A_Thing: Array_Type(Enumeration_Type) := (
    A => ... ,
    B => ... ,
    C => ... );

  Another_Thing: Array_Type(Another_Emuneration_Type) := (
    X => ... ,
    Y => ... ,
    Z => ... );

This makes sense to me, but does not compile. So how do I code the idea?

Thanks.

| |,| | | |RuaFranciscoTaborda24RcD 2815-249CharnecaCaparica 351+939354002
|M|A|R|I|O|
|A|M|A|D|O|DepartmentoDeInformaticaFCT/UNL 2825-114 Caparica 351+212958536
|A|L|V|E|S|                                                  fax 212948541
| | | | | |                 maa@di.fct.unl.pt                FCT 212948300









             reply	other threads:[~2000-07-19  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-19  0:00 Mario Amado Alves [this message]
2000-07-20  0:00 ` array(enumeration) Philip Anderson
2000-07-20  0:00 ` array(enumeration) Steve Folly
2000-07-20  0:00 ` array(enumeration) Frode Tenneboe
replies disabled

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