Re: New to Ada, noticing something strange.
- From: "Jeffrey R. Carter" <spam@xxxxxxxx>
- Date: Fri, 30 Sep 2005 06:28:14 GMT
mike.martelli@xxxxxxxxx wrote:
if not (Integer'Value(To_String(base)) > 1) or not (Integer'Value(To_String(base)) < 16) then
You might find "in" and "not in" (subtype membership operations) useful. The general form is
Value [not] in Subtype
"in" returns True if Value is a member of Subtype; "not in" if Value is not a member. This is defined for all types:
task type T (D : Integer);
subtype T1 is T (D => 1);
X : T (D => 7);
if X in T1 then -- True if X.D = 1
For a discrete type, the subtype may be given by a range:
if Integer'Value (To_String (Base) ) not in 1 .. 16 then
-- Jeff Carter "There's no messiah here. There's a mess all right, but no messiah." Monty Python's Life of Brian 84 .
- References:
- New to Ada, noticing something strange.
- From: mike . martelli
- Re: New to Ada, noticing something strange.
- From: Jeffrey R. Carter
- Re: New to Ada, noticing something strange.
- From: mike . martelli
- Re: New to Ada, noticing something strange.
- From: mike . martelli
- New to Ada, noticing something strange.
- Prev by Date: Re: New to Ada, noticing something strange.
- Next by Date: Re: Code completion in ada IDE's
- Previous by thread: Re: New to Ada, noticing something strange.
- Next by thread: Re: New to Ada, noticing something strange.
- Index(es):
Relevant Pages
|