comp.lang.ada
 help / color / mirror / Atom feed
From: christoph.grein@eurocopter.com
Subject: Re: What's wrong with my code?
Date: Mon, 28 Apr 2008 22:30:29 -0700 (PDT)
Date: 2008-04-28T22:30:29-07:00	[thread overview]
Message-ID: <c5eccb5b-4807-48e4-b940-d1cf2f6aa531@y38g2000hsy.googlegroups.com> (raw)
In-Reply-To: 5a3b83ab-c9eb-448d-8e01-093df11bd3d2@b1g2000hsg.googlegroups.com

Integer as an index is too big. Why not:

type Index is range 0..10;
subtype Index is Integer range 0..10;  -- alternatively
type My_Array is array (Index) of Element;

procedure Find_Min (A: My_Array; Offset, Pos: Index);
procedure Swap (A: in out My_Array; First, Second: Index);

etc



  parent reply	other threads:[~2008-04-29  5:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 14:42 What's wrong with my code? amal.alphonse
2008-04-28 15:18 ` stefan-lucks
2008-04-28 15:22   ` stefan-lucks
2008-04-28 15:24     ` stefan-lucks
2008-04-28 15:23 ` george.priv
2008-04-28 16:52 ` Ivan Levashew
2008-04-29  9:18   ` Ludovic Brenta
2008-04-29  5:30 ` christoph.grein [this message]
2008-04-29  9:31 ` Ludovic Brenta
2008-04-29 10:33 ` amal.alphonse
replies disabled

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