comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: how to check if a string variable contains a number or string?
Date: 18 Nov 2002 16:09:39 -0500
Date: 2002-11-18T21:21:12+00:00	[thread overview]
Message-ID: <u4raetwj0.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: a04a773e.0211181241.4e9e13b0@posting.google.com

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



  reply	other threads:[~2002-11-18 21:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-18 20:41 how to check if a string variable contains a number or string? Sarah Thomas
2002-11-18 21:09 ` Stephen Leake [this message]
2002-11-18 21:50   ` David C. Hoos
2002-11-19  0:44 ` sk
2002-11-19  1:21   ` Jeffrey Carter
2002-11-19  4:41     ` sk
2002-11-19 17:02       ` Jeffrey Carter
2002-11-24  0:10         ` AG
2002-11-23 20:05           ` Jeffrey Carter
2002-11-19  1:26 ` Jeffrey Carter
2002-11-19  3:19 ` SteveD
2002-11-19  9:38 ` Preben Randhol
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox