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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,edafb2ab7e8839bc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!f16g2000cwb.googlegroups.com!not-for-mail From: "KE" Newsgroups: comp.lang.ada Subject: Re: Char type verification Date: 15 Nov 2006 15:33:52 -0800 Organization: http://groups.google.com Message-ID: <1163633632.764424.140640@f16g2000cwb.googlegroups.com> References: <1163628033.606530.190550@i42g2000cwa.googlegroups.com> NNTP-Posting-Host: 88.240.56.59 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1163633638 19184 127.0.0.1 (15 Nov 2006 23:33:58 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 15 Nov 2006 23:33:58 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 1.0.3705; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: f16g2000cwb.googlegroups.com; posting-host=88.240.56.59; posting-account=SU8_Kw0AAABcLlEzcdMhoDhwaHkS8xUq Xref: g2news2.google.com comp.lang.ada:7483 Date: 2006-11-15T15:33:52-08:00 List-Id: Thanks, Simon. I understand that ".." is an operator that Ada coders are very fond of. But what if the "UCASE" array was not a set of contiguous values from a specific range? In more general terms, how would we use a tested value as an index to a lookup table to verify a property of that value from that table? Not that this is necessarily a big deal. Perhaps there's something about that Ada way that is grabbing me yet. It should be obvious, but "obvious" in Latin means "overlooked." Sorry for taking your time. Thanks again -- KE Simon Wright wrote: > "KE" writes: > > Hmm, the trouble is that one just wouldn't! > > > static uchar UCASE[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; > > > > int _isupper(uchar c) > > { > > return (c==UCASE[(c%'A')%26]); > > } > > function Is_Upper (C : Character) return Boolean is > begin > return C in 'A' .. 'Z'; > end Is_Upper; > > --S