comp.lang.ada
 help / color / mirror / Atom feed
From: "DuckE" <nospam_steved94@home.com>
Subject: Re: User defined boolean
Date: Mon, 30 Oct 2000 01:02:55 GMT
Date: 2000-10-30T01:02:55+00:00	[thread overview]
Message-ID: <3N3L5.30691$E85.782438@news1.sttls1.wa.home.com> (raw)
In-Reply-To: 39FB723B.25D05446@erols.com

You can certainly override the built in AND and OR operations to work for
your new type:

   type Pass_Flag is (Fail, Pass);

   function "AND" ( Left, Right : Pass_Flag ) return Boolean is
   begin
      return (Left = Pass) and (Right = Pass);
   end "AND";

   function "OR" ( Left, Right : Pass_Flag ) return Boolean is
   begin
      return (Left = Pass) or (Right = Pass);
   end "OR";

SteveD

"Daniel Allex" <dallex@erols.com> wrote in message
news:39FB723B.25D05446@erols.com...
> I created a type PASS_FLAG that is an enumeration type of FAIL and
> PASS.  I have seven funtions that each return PASS_FLAG, and I wanted to
> AND them together an print out the result.  My flag wont work with
> either AND or "+".  Can this be done or should I just use the predefined
> boolean.  I had reasons for defining my own enumeration type.
>





  parent reply	other threads:[~2000-10-30  1:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-29  0:41 User defined boolean Daniel Allex
2000-10-29  1:22 ` Ken Garlington
2000-10-30  1:02 ` DuckE [this message]
2000-10-30  1:58   ` Robert Dewar
2000-10-31  3:56     ` DuckE
2000-10-31 19:48       ` Robert Dewar
replies disabled

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