From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9d0f079e3d2d7be7 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Array index ? Date: 1998/01/29 Message-ID: #1/1 X-Deja-AN: 320492695 Content-Transfer-Encoding: 8bit References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1998-01-29T00:00:00+00:00 List-Id: In article , SiliconJesus wrote: >I am trying to write some code that allows me to make an array of records >and I want the array to have index for a string of 4,so Array(Sock) like a >warehouse storage type program, I know this should be trivial to me, but >I've been coding in C++ and Java for a semester and have forgotten some of >my Ada roots, any help would be appreciated. Do you mean you want an array whose index subtype is a subtype of String, as in subtype T_Index is String (1 .. 4); type T is array (T_Index) of R; If so, you can't do that, because arrays can only have a discrete subtype (integer or enumeration type) as the index subtype. You probably want a more abstract data structure, such as a dictionary (sort of like a symbol table - consult you fave compiler book) or a trie-structure (not a misspell) or a hash table, etc. -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271