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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no 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 20:47:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!enst.fr!not-for-mail From: sk Newsgroups: comp.lang.ada Subject: Re: how to check if a string variable contains a number or string? Date: Mon, 18 Nov 2002 22:41:22 -0600 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <3DD99222.5010904@acm.org> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1037681222 38733 137.194.161.2 (19 Nov 2002 04:47:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 19 Nov 2002 04:47:02 +0000 (UTC) Return-Path: X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19-4.3mdk i686) X-Accept-Language: en Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:31083 Date: 2002-11-18T22:41:22-06:00 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 -------------------------------------