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-Language: ENGLISH,ASCII X-Google-Thread: 103376,6122265fe3a60a37 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-06 09:42:18 PST Message-ID: <3B1E5BAA.49F1EF9B@amsjv.com> Date: Wed, 06 Jun 2001 17:34:50 +0100 From: Philip Anderson Organization: Alenia Marconi Systems ISD X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Some problems with string type References: <3B1EE460.D08AD019@wanadoo.fr> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: cwmwkn0612.cwmbran.gecm.com X-Trace: 6 Jun 2001 17:26:21 GMT, cwmwkn0612.cwmbran.gecm.com Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!demon!diablo.netcom.net.uk!netcom.net.uk!btnet-peer!btnet-peer0!btnet-feed5!btnet!newreader.ukcore.bt.net!pull.gecm.com!cwmwkn0612.cwmbran.gecm.com Xref: archiver1.google.com comp.lang.ada:8244 Date: 2001-06-06T17:34:50+01:00 List-Id: Valdes wrote: > > I have my program writen in Ada that raise some exceptions: > > raised CONSTRAINT_ERROR : gestindex.adb:5 > > ... And at line 5... > > function createindex (S:string) return index is > I:Index; > begin > i.nameindex:=s; -- Ligne cinq Note that Constraint Error will be raised if s is not _exactly_ 20 characters long. > i.firstletter:=null; > return i; > end createindex; > > ... The index record is defined as follow... > > type index is record > nameindex:String(1..20); > firstletter:ptrletter; > end record; > > ... The mistake seems to be trivial but I don't see it. > > I have seen the same for this also: > > Ptrtemp.Letter:=Charat(M,Ni); > > there is the same error but Charat return a character and letter is also > one. (ptrtemp is also type ptrlettre) Is M a String and Ni an index into it? If so Ni must be within the range M'first .. M'last, and M'first may be greater than 1 (and won't be 0). > All my greetings if you have some ideas. And forgive me for my bad > english. Pas de probleme. > -- > Le Vif Z�phyr Jubile Sur Les Kumquats Du Clown Gracieux. The quick brown fox jumps over the lazy dog. -- hwyl/cheers, Philip Anderson Alenia Marconi Systems Cwmbr�n, Cymru/Wales