comp.lang.ada
 help / color / mirror / Atom feed
From: Mehdi Saada <00120260a@gmail.com>
Subject: Re: alternative elsif branch not tested
Date: Thu, 22 Feb 2018 15:09:15 -0800 (PST)
Date: 2018-02-22T15:09:15-08:00	[thread overview]
Message-ID: <fd7c28a6-5605-4521-b9e9-f88b47b9714d@googlegroups.com> (raw)
In-Reply-To: <3c869714-ed23-42dd-b0de-4521733da615@googlegroups.com>

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'.
 
      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;

  reply	other threads:[~2018-02-22 23:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 22:54 alternative elsif branch not tested Mehdi Saada
2018-02-22 23:09 ` Mehdi Saada [this message]
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
replies disabled

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