comp.lang.ada
 help / color / mirror / Atom feed
* alternative elsif branch not tested
@ 2018-02-22 22:54 Mehdi Saada
  2018-02-22 23:09 ` Mehdi Saada
  0 siblings, 1 reply; 11+ messages in thread
From: Mehdi Saada @ 2018-02-22 22:54 UTC (permalink / raw)


This piece shall verify the program's arguments. I don't understand why whatever the first argument is, it doesn't raise EXC_COMMANDE as expected.
It should do it if ARGUMENT(1)(1) isn't 'n','c','N','C'.
Except that, everything worked just fine. Almost at the first attempt !

      if Argument_Count /= 2 then PUT_LINE ("Pas le bon nombre d'arguments."); raise Exc_Commande;
      elsif Argument (1)'Length /= 1 and ARGUMENT(1)(1) not in 'n'| 'c'| 'N' | 'C' then
	 PUT_LINE ("Première argument incorrect: veuillez mettre un (seul) charactère entre n, c, N et C."); raise Exc_Commande;
      elsif ADA.Strings.Fixed.Index (Argument (2), Alphanumeric_Set, Outside) /= 0 then
	 PUT_LINE ("Deuxième argument incorrect: l'acronyme ne peut pas contenir de chiffres !"); raise Exc_Commande;
      end if;


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-02-23 20:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 22:54 alternative elsif branch not tested Mehdi Saada
2018-02-22 23:09 ` Mehdi Saada
2018-02-22 23:29   ` Anh Vo
2018-02-22 23:54   ` Randy Brukardt
2018-02-23 10:51     ` Mehdi Saada
2018-02-23 11:04       ` briot.emmanuel
2018-02-23 17:34       ` Jeffrey R. Carter
2018-02-23 19:31         ` Mehdi Saada
2018-02-23 19:39   ` Mehdi Saada
2018-02-23 19:53     ` Jeffrey R. Carter
2018-02-23 20:25       ` Mehdi Saada

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