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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5221eea63340249 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-18 17:26:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3DD99344.9020200@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: how to check if a string variable contains a number or string? References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 19 Nov 2002 01:26:43 GMT NNTP-Posting-Host: 63.184.0.62 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1037669203 63.184.0.62 (Mon, 18 Nov 2002 17:26:43 PST) NNTP-Posting-Date: Mon, 18 Nov 2002 17:26:43 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:31079 Date: 2002-11-19T01:26:43+00:00 List-Id: Sarah Thomas wrote: > I have an array of strings that I read in from a file. I want to check > if each element in the array is a string or if it is a number. is > there any predefined functions that would help do that? thanks Since you have an array of strings, obviously each element of the array is a string. Presumably you mean you want to check if a string contains the image of a number or not. In that case, what do you mean by a number? An integer value, or a real value? Are embedded underscores acceptable? How about an exponent? Based numbers? Does "2#0101_1010.0011#E5" represent the image of a number? Once you've answered these questions you can decide if 'Value or something from Ada.Text_IO is acceptable, or if you're going to have to write code to parse the string manually. -- Jeff Carter "Brave Sir Robin ran away." Monty Python and the Holy Grail