comp.lang.ada
 help / color / mirror / Atom feed
From: sk <noname@myob.com>
Subject: Re: how to check if a string variable contains a number or string?
Date: Mon, 18 Nov 2002 22:41:22 -0600
Date: 2002-11-18T22:41:22-06:00	[thread overview]
Message-ID: <mailman.1037681222.31134.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: 3DD99222.5010904@acm.org

Hi,

> Reinventing the wheel is never better than reusing 
> existing subprograms.

To some extent I agree, but consider 

1) Known format files ...
-- First-Name Last-Name Age ...
John Doe 42
Jane Doe q
         ^ Exception OK

2) A file of one type only ...
34.7
23.9
143.67
hello <- Exception Ok

3) A random file 
The quick brown Fox bought 3 carrots for $0.34

I would consider using exceptions to realize
that the number and price of carrots are numeric
amounts rather than just strings to be a bad 
technique !

The OP made no mention of fixed format, only
determining strings or numbers.



-- 
-------------------------------------
-- Merge vertically for real address
-------------------------------------
s n p @ t . o
 k i e k c c m
-------------------------------------



  reply	other threads:[~2002-11-19  4:41 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
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 [this message]
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