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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd40601768eaf8fd X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Array of Variant Records Question... Date: 1999/09/08 Message-ID: <7r66fe$p3b$1@nnrp1.deja.com>#1/1 X-Deja-AN: 522576776 References: <7r5vh3$imu1@svlss.lmms.lmco.com> X-Http-Proxy: 1.0 x43.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Wed Sep 08 17:30:22 1999 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.6 [en] (WinNT; I) Date: 1999-09-08T00:00:00+00:00 List-Id: In article <7r5vh3$imu1@svlss.lmms.lmco.com>, "Bruce Detter" wrote: > How do you declare an array of variant records where each variant record's > descriminant is the array index? Can it be done at all? I would prefer not > to use access pointers if it can be avoided. I don't really see a way to do that. I think you'd have to load those values into the record discrimintants manually. If the record type has a default value for the discriminant you could use a loop to do it. Otherwise you will have to load each discriminant value in literally in an initialization when the object is declared. Alternatively you could try creating an (impure) function that returns the first index the first time its called, and a number 1 higher each subsequent time. Then you could use that function to initialize the discriminant fields in the records when they are declared. Out of curiosity, what are you trying to accomplish with this? The typical use for a numerical discriminant in a variant record is to size an array subfield of that record. What you are asking for would then give you a sort of triangular matrix; an interesting structure indeed. -- T.E.D. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.