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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7ba49aac4e73460 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.226.10 with SMTP id ro10mr3939883pbc.6.1328887275928; Fri, 10 Feb 2012 07:21:15 -0800 (PST) Path: wr5ni9020pbc.0!nntp.google.com!news2.google.com!postnews.google.com!x19g2000yqh.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Need Help On Ada95 Problem Date: Fri, 10 Feb 2012 07:19:46 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <553ceec3-ec34-41de-9723-0dc342379cfe@vv9g2000pbc.googlegroups.com> <4ea6309f-cf07-44f6-8c56-5189a0081dcc@g27g2000yqa.googlegroups.com> NNTP-Posting-Host: 24.230.151.194 Mime-Version: 1.0 X-Trace: posting.google.com 1328887275 11797 127.0.0.1 (10 Feb 2012 15:21:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Feb 2012 15:21:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x19g2000yqh.googlegroups.com; posting-host=24.230.151.194; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-02-10T07:19:46-08:00 List-Id: On Feb 9, 11:32=A0pm, "Alex" wrote: > Sure you can just use 'Pos! While the positions of the digit characters > do not correspond directly to their values, they are sequential in the > ASCII mapping, so all you have to do is subtract the position of the > Character '0' from each one to calculate its value. Check it out: > I know that, I've done it before; I think you misunderstood what I was trying to say here (or perhaps I was simply using the wrong language): > > Shark8 wrote: > > You can't just index into Character (via 'POS, 'VAL and index- > > manipulation) because the mapping isn't sequential; > > or even partly-sequential in the ASCII codes. > > > See the (3,4,5) association with (V,A,L) and (6,7,8) with (T,I,N). Do, let me rephrase: Letting F(I) be the function taking an integer and returning the correct character we see that F(3) =3D V, F(4) =3D A, and F(5) =3D L; this means that the internals of F cannot be a simple offset indexing into ASCII. Furthermore, as F(6) =3D T, F(7) =3D I, and F(8) =3D N we see that there is no intuitively obvious subcycle such as one sees when numbering a chessboard (the multiplication/mod relationship). Therefore, using a mathematical (arithmetic) function to relate these numbers and the associated ASCII codes is likely inappropriate.