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,c26a0bb87e0a1da4 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!news2.google.com!postnews.google.com!k18g2000prf.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: Does ada have a sscanf equivalent? Date: Mon, 22 Feb 2010 15:11:21 -0800 (PST) Organization: http://groups.google.com Message-ID: <8432d8b0-acd0-439f-8366-d72f53571f90@k18g2000prf.googlegroups.com> References: <5e46b3e8-f7ea-45a6-a884-6882f6ec8295@c16g2000yqd.googlegroups.com> NNTP-Posting-Host: 75.172.190.146 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1266880281 8151 127.0.0.1 (22 Feb 2010 23:11:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 22 Feb 2010 23:11:21 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k18g2000prf.googlegroups.com; posting-host=75.172.190.146; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/528.16+(KHTML, like Gecko, Safari/528.16) OmniWeb/v622.8.0,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9291 Date: 2010-02-22T15:11:21-08:00 List-Id: On Feb 22, 12:48=A0pm, jpwoodruff wrote: > On Feb 22, 1:08=A0am, "J.s" wrote: > > > I am trying to translate some C code that parses a string into numbers > > (both Integers and Floats) from an input file. Would it be easiest to > > just import the C function or is there an Ada equivalent? > > Let me offer a product of my own devising. > > "The packages Numeric_IO and Name_IO, together with their children and > support, assist a program to read a user=92s input. =A0The packages are > intended to support numerical computation by providing Get and Put > procedures for floating numbers and for vectors and matrices of > floating numbers. > > "The procedures ease an end-user=92s burden in preparing inputs for > computational programs. =A0The rules for input of floating numbers are > relaxed so that program inputs need not conform to the strict Ada > syntax for floating numbers. Facilities allow input either from files > or interactively. Consistent policies throughout all the services > allow programs to address input errors, to prompt the end-user > interactively or to specify optional default values." > > Dmitry has been kind enough to make it available. > > http://www.dmitry-kazakov.de/ada/Numeric-Name-IO > > -- > John This looks pretty cool. But it doesn't seem to use the Ada 2005 definitions for matrices and vectors. I haven't looked at the code but I wonder how hard it would be to create such a version. I would think it should be pretty easy. Jerry