comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: alternative elsif branch not tested
Date: Thu, 22 Feb 2018 17:54:15 -0600
Date: 2018-02-22T17:54:15-06:00	[thread overview]
Message-ID: <p6nl78$tci$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: fd7c28a6-5605-4521-b9e9-f88b47b9714d@googlegroups.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

I'd suggest looking again at DeMorgan's Law of boolean expressions. I've 
made this mistake dozens of times over the years.

                                 Randy.

"Mehdi Saada" <00120260a@gmail.com> wrote in message 
news:fd7c28a6-5605-4521-b9e9-f88b47b9714d@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; 


  parent reply	other threads:[~2018-02-22 23:54 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
2018-02-22 23:29   ` Anh Vo
2018-02-22 23:54   ` Randy Brukardt [this message]
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