From: "Matthew Heaney" <mheaney@on2.com>
Subject: Re: Naturals and discrete types
Date: Thu, 1 Nov 2001 17:35:50 -0500
Date: 2001-11-01T17:35:50-05:00 [thread overview]
Message-ID: <tu3jc1d84bt748@corp.supernews.com> (raw)
In-Reply-To: oGjE7.221593$K6.106487221@news2
"Clueless" <chris@dont.spam.me> wrote in message
news:oGjE7.221593$K6.106487221@news2...
> The Ada.Command_Line package returns a Natural type, however I've been
> attempting to count the arguments using the Range attribute which expects
> a discrete type.
The 'Range attribute describes the range of values in a scalar type. If you
want to know you many command line arguments there are, call Argument_Count.
> What I've been doing is converting the Natural to an Integer using the
> Value attribute. Sometimes this works, and sometimes I get an Exception.
Huh? Natural is already an Integer (it's a subtype).
> Is it possible to get the 'Range function to accept a Natural type? Or am
> I trekking down the wrong path entirely? It seems there has to be a better
> way to do this.
You seem to be confused...
> Also, I've been checking my Ada docs to find out if the Natural type is
> considered to be a Discrete or Real type by the GNAT compiler, but I
> havent found any specific info yet. Although the compiler messages
> certainly seem to indicate that Natural is a subtype of Real.
It's a discrete type.
next prev parent reply other threads:[~2001-11-01 22:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-01 22:05 Naturals and discrete types Clueless
2001-11-01 22:35 ` Matthew Heaney [this message]
2001-11-01 22:59 ` Clueless
2001-11-02 15:05 ` Marin David Condic
2001-11-02 17:24 ` Ted Dennison
2001-11-02 18:19 ` Preben Randhol
2001-11-02 18:51 ` Marin David Condic
2001-11-03 18:01 ` Nick Roberts
2001-11-04 4:18 ` tmoran
2001-11-05 15:29 ` Marin David Condic
2001-11-04 11:39 ` Preben Randhol
2001-11-05 2:01 ` Clueless
2001-11-05 2:37 ` Larry Kilgallen
-- strict thread matches above, loose matches on Subject: below --
2001-11-01 23:06 Beard, Frank
2001-11-01 23:20 ` Clueless
2001-11-02 3:05 ` DuckE
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox