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,64a2795a04707a01 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!postnews.google.com!z16g2000prn.googlegroups.com!not-for-mail From: JPWoodruff@gmail.com Newsgroups: comp.lang.ada Subject: Re: Converting Integer / Float to String Date: Sat, 19 Jul 2008 17:28:07 -0700 (PDT) Organization: http://groups.google.com Message-ID: <111f09f0-b596-45d6-8321-ebe8a0dd67c8@z16g2000prn.googlegroups.com> References: NNTP-Posting-Host: 69.20.181.170 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1216513687 9633 127.0.0.1 (20 Jul 2008 00:28:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 20 Jul 2008 00:28:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z16g2000prn.googlegroups.com; posting-host=69.20.181.170; 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.8.1.16) Gecko/20080702 Firefox/2.0.0.16,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1227 Date: 2008-07-19T17:28:07-07:00 List-Id: On Jul 17, 1:49 am, "Alexander Camek" wrote: > Hi List, > > is there another way to convert a given String to an Integer or Float typ= e? > Perhaps you could use some part of the numeric IO packages I constructed some years back: http://www.dmitry-kazakov.de/ada/Numeric-Name-IO.htm (Dmitry has kindly hosted the distribution of my contribution) 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 =93Get=94 and =93Put= =94 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. Name-directed input can be used to read a file of input data, even including physical units as defined by Dmitry's Measures_Edit. Here are example lines from an input file that could be read by your program that employs these packages: Vect :=3D 1.414, 1.732, 2.0 ; P :=3D 14.9 psi ; -- one standard atmosphere -- John