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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.107.181.20 with SMTP id e20mr1488902iof.43.1519914685014; Thu, 01 Mar 2018 06:31:25 -0800 (PST) X-Received: by 10.157.0.5 with SMTP id 5mr99287ota.0.1519914684724; Thu, 01 Mar 2018 06:31:24 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!e10no539142itf.0!news-out.google.com!a2ni3261ite.0!nntp.google.com!e10no539141itf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 1 Mar 2018 06:31:24 -0800 (PST) In-Reply-To: <1e744a67-b2bf-437c-b503-8bd4c13da655@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.245.163.78; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.245.163.78 References: <39fc7bbf-77e8-4342-9af7-68cb5e9acb8a@googlegroups.com> <1e744a67-b2bf-437c-b503-8bd4c13da655@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4fadc92f-cf14-4aeb-ba1a-9bdb2114f172@googlegroups.com> Subject: Re: CONSTRAINT ERROR? access check failed From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Thu, 01 Mar 2018 14:31:25 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2420 X-Received-Body-CRC: 1843252754 Xref: reader02.eternal-september.org comp.lang.ada:50749 Date: 2018-03-01T06:31:24-08:00 List-Id: Now I understand: it was part of a bigger loop, and once nothing was entered as a command, the whole loop was walked through, and the file asked again. I just had to put INNER before the main loop. Why can't I see that immediately... Thanks for your contribution, though. When entering a file name, it raised raised ADA.IO_EXCEPTIONS.END_ERROR : a-tigeli.adb:96 No exception handler seem to catch that exception. Yet it happens only when I provided an existing file name. The (rewritten) loop; loop declare NOM_FICHIER : String := Get_Line; INDICE : NATURAL := 0; begin if Index_Non_Blank (NOM_FICHIER) /= 0 then if not Exists (NOM_FICHIER) then Put_Line ("N'existe pas. Recommencez."); else OPEN (FILE_ENTREE, In_File, NOM_FICHIER); Set_Input (FILE_ENTREE); begin while not End_Of_File loop INDICE := INDICE + 10; INSERT_OR_REPLACE (INDICE, LET_ONLY_GRAPHIC_CHARACTERS (GET_LINE)); end loop; exit; exception when others => PUT_LINE ("HERE !"); end; end if; end if; end; end loop; I put exception handlers EVERYWHERE, in every function called, besides standard libraries' ones, of course.