comp.lang.ada
 help / color / mirror / Atom feed
From: Mehdi Saada <00120260a@gmail.com>
Subject: Re: CONSTRAINT ERROR? access check failed
Date: Thu, 1 Mar 2018 06:31:24 -0800 (PST)
Date: 2018-03-01T06:31:24-08:00	[thread overview]
Message-ID: <4fadc92f-cf14-4aeb-ba1a-9bdb2114f172@googlegroups.com> (raw)
In-Reply-To: <1e744a67-b2bf-437c-b503-8bd4c13da655@googlegroups.com>

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.


  reply	other threads:[~2018-03-01 14:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  0:27 CONSTRAINT ERROR? access check failed Mehdi Saada
2018-03-01  8:07 ` Niklas Holsti
2018-03-01 12:44   ` Mehdi Saada
2018-03-01 13:45     ` Björn Lundin
2018-03-01 14:06   ` Mehdi Saada
2018-03-01 14:31     ` Mehdi Saada [this message]
2018-03-01 14:38     ` Mehdi Saada
2018-03-01 15:53       ` Anh Vo
2018-03-01 17:24         ` Mehdi Saada
2018-03-01 18:34           ` Anh Vo
2018-03-01 17:26       ` Simon Wright
2018-03-01 17:47         ` Mehdi Saada
2018-03-01 17:56       ` Jeffrey R. Carter
2018-03-01  8:30 ` Simon Wright
2018-03-01 12:14   ` Mehdi Saada
2018-03-01 13:27     ` Simon Wright
2018-03-01 13:44       ` Mehdi Saada
replies disabled

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