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: a07f3367d7,c26a0bb87e0a1da4 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!postnews.google.com!b5g2000prd.googlegroups.com!not-for-mail From: jpwoodruff Newsgroups: comp.lang.ada Subject: Re: Does ada have a sscanf equivalent? Date: Mon, 22 Feb 2010 11:48:09 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <5e46b3e8-f7ea-45a6-a884-6882f6ec8295@c16g2000yqd.googlegroups.com> NNTP-Posting-Host: 71.204.168.192 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1266868090 5350 127.0.0.1 (22 Feb 2010 19:48:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 22 Feb 2010 19:48:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b5g2000prd.googlegroups.com; posting-host=71.204.168.192; posting-account=eLk0BgoAAAA-yA75xm1L7heSizMaESVg User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9290 Date: 2010-02-22T11:48:09-08:00 List-Id: 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. The 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. The 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