From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,58e0097f787e49d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-01 14:59:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!newshub2.rdc1.sfba.home.com!news.home.com!news2.POSTED!not-for-mail From: "Clueless" Subject: Re: Naturals and discrete types Newsgroups: comp.lang.ada References: User-Agent: Pan/0.10.0 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: "Clueless" Message-ID: Date: Thu, 01 Nov 2001 22:59:48 GMT NNTP-Posting-Host: 24.0.109.49 X-Complaints-To: abuse@home.net X-Trace: news2 1004655588 24.0.109.49 (Thu, 01 Nov 2001 14:59:48 PST) NNTP-Posting-Date: Thu, 01 Nov 2001 14:59:48 PST Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:15596 Date: 2001-11-01T22:59:48+00:00 List-Id: In article , "Clueless" wrote: > Recently I've been monkeying with the Ada.Command_Line package. > > Now I'm running into trouble reading the argument count. > > 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. > 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. > > 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. > > 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. > > Forgive me if this question seems mundane. I've never really had to > worry about the difference back when I was doing C. Heh. > > Any clarification, or pointers to the pertinent docs, would be helpful. > > Clueless > McDoobie > chris@dont.spam.me Alright...I've got the Command_Line package figured out. Basically, I stopped trying to rewrite what was already there. Heh. However, I'm still a little fuzzy on the best way to convert between real and discrete types. Thanks for any pointers. McDoobie Clueless chris@dont.spam.me