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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,685d80ec307a0c X-Google-Attributes: gid103376,public From: Jerry Petrey Subject: Re: use of attribute Pos Date: 2000/10/11 Message-ID: <39E4A719.A5E7595C@west.raytheon.com>#1/1 X-Deja-AN: 680232499 Content-Transfer-Encoding: 7bit References: <39E4A08D.B454CB1C@laas.fr> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 971286299 138.126.254.210 (Wed, 11 Oct 2000 13:44:59 EDT) Organization: Raytheon Company MIME-Version: 1.0 NNTP-Posting-Date: Wed, 11 Oct 2000 13:44:59 EDT Newsgroups: comp.lang.ada Date: 2000-10-11T00:00:00+00:00 List-Id: Philippe Torres wrote: > > Hi, do you think the following behaviour is normal ? > ----- > subtype Upper is character range 'A'..'Z' ; > begin > Put(Upper'Pos('A')) ; > ----- > Output : 65 > > I was expecting 0 since 'A' is the first element of Upper but i got > the ranking of 'A' in the Character type. > > What's the point of defining constrained subtype if we can't use the > attributes on it ? Or am i missing something ? > > I use gnatmake to compile. > > Philippe 'Pos will give you the position in the "base" type which is Character and thus 65 is correct. Jerry -- ----------------------------------------------------------------------------- -- Jerry Petrey -- Senior Principal Systems Engineer - Member Team Ada & Team Forth -- Raytheon Missile Systems -- NOTE: please remove NOSPAM in email address to reply -----------------------------------------------------------------------------