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 13:29:21 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: how to check if a string variable contains a number or string? Date: 18 Nov 2002 16:09:39 -0500 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1037654472 14902 128.183.235.92 (18 Nov 2002 21:21:12 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 18 Nov 2002 21:21:12 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:31070 Date: 2002-11-18T21:21:12+00:00 List-Id: mabes180@aol.com (Sarah Thomas) writes: > 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 This sounds like a homework problem. If it is, please say so. We don't do homework for you, but we can give advice. Since you are reading strings, obviously what you got is a string. It's possible that the string contains a valid number; I guess that is what you want to check. Try reading the number from the string using Ada.Text_IO.*. -- -- Stephe