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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,9d2e7de2b6057996 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!y10g2000prf.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Comparison Operators for Strings Date: Tue, 25 Aug 2009 18:45:46 -0700 (PDT) Organization: http://groups.google.com Message-ID: <786229e2-708e-46a4-85bb-2c6eb2d9e9bf@y10g2000prf.googlegroups.com> References: <59ccf9ff-86ea-4179-8be3-a7f99218eeb5@q40g2000prh.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1251251146 31972 127.0.0.1 (26 Aug 2009 01:45:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 26 Aug 2009 01:45:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y10g2000prf.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7979 Date: 2009-08-25T18:45:46-07:00 List-Id: On Aug 25, 6:37=A0pm, "Steve D" wrote: > "Rick" wrote in message > > news:59ccf9ff-86ea-4179-8be3-a7f99218eeb5@q40g2000prh.googlegroups.com... > > > How do the comparison operators for Strings (Fixed-length, Unbounded, > > whatever) actually work? =A0I am using Unbounded_String at the moment > > and in the LRM I find: > > > 83 Each of the functions "=3D", "<", ">", "<=3D", and ">=3D" returns th= e > > same result as the corresponding String operation applied to the > > String values given or represented by Left and Right. > > > I have checked LRM 2.6, 3.6.3, and A.4 to A.4.8 and I cannot find a > > result for a corresponding String operation. > > > Where should I be looking? > > LRM 4.5.2 Relational Operators an Membership tests > Paragraph (18) > > The type "String" is nothing special and is defined in System: > > type String is array(Positive range <>) of Character; > =A0 =A0pragma Pack(String); > > You compare strings the same way as you can any other one dimensional arr= ay > as described in 4.5.2(18) Well, not *any* other one-dimensional array; the ordering operations ("<", "<=3D", ">", ">=3D") are defined only for one-dimensional arrays of a *discrete* type (i.e. integer or enumeration; Character is an enumeration type). 4.5.2(18) only applies to "=3D", by the way. For ordering operators, see 4.5.2(8-9) and 4.5.2(26). -- Adam