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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8d87eba0b8755b48 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s72.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: making compare function with multiple values(help for newbie) References: <1160607835.370325.213610@e3g2000cwe.googlegroups.com> In-Reply-To: <1160607835.370325.213610@e3g2000cwe.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s72 1160631393 12.201.97.213 (Thu, 12 Oct 2006 05:36:33 GMT) NNTP-Posting-Date: Thu, 12 Oct 2006 05:36:33 GMT Date: Thu, 12 Oct 2006 05:36:33 GMT Xref: g2news2.google.com comp.lang.ada:6927 Date: 2006-10-12T05:36:33+00:00 List-Id: isaac2004 wrote: > hello for a assignment in one of my classes, i am asked to add 3 values > to an array for every appearance of the index (so 3 values like 222, 5, > 4 are in one index of the array) and then compare a user prompt to see > if the exact index is in the array, i can do this if there is only one > value but im haveing trouble getting my head around the comparing of > three values at once could i just use nested conditionals in a for > loop. any algorithm ideas would be greatly appreciated. thank you What are the components of the array? A record: type Three_Values is record First : Integer; Second : Integer; Third : Integer; end record; type Three_At_Each is array (Positive range <>) of Three_Values; An array: type Three_Values is array (Positive range 1 .. 3) of Integer; type Three_At_Each is array (Positive range <>) of Three_Values; Or are you using a 2D array: type Two_D is array (Positive range <>, Positive range <>) of Integer; type Three_At_Each (Num_Rows : Positive) is record Value : Two_D (1 .. Num_Rows, 1 .. 3); end record; Or something else I haven't thought of? -- Jeff Carter "I blow my nose on you." Monty Python & the Holy Grail 03