Article View: borland.public.delphi.language.objectpascal
Article #32452Re: How to check if a string value contains a numeric character
From: Martin Potokar
Date: Sat, 23 Nov 2002 10:25
Date: Sat, 23 Nov 2002 10:25
55 lines
3156 bytes
3156 bytes
Must be a problem with the server given several idential replies (some with the same name) but Martin James was first to suggest this particular solution in response to my original post: Or, even more impressive, use a set: if not myString[index] in ['0'..'9'] then.... Wouldn't compile at first in Delphi 6 Enterprise (given the message 'Operator not applicable to this type of Operand') until I added parentheses as follows: if not (myString[index] in ['0'..'9']) then.... While there is more than one way to skin a chicken, this seems to work the best. Thanks to all for your feedback. Marty Potokar "Dr John Stockton" <spam@merlyn.demon.co.uk> wrote in message news:vg53EoBTFp39EwCM@merlyn.demon.co.uk... > JRS: In article <3dddff49@newsgroups.borland.com>, seen in news:borland > .public.delphi.language.objectpascal, Martin James > <mjames_falcon@dial.pipex.com> posted at Fri, 22 Nov 2002 09:53:32 :- > > > >Or, even more impressive, use a set: > > > >if not myString[index] in ['0'..'9'] then.... > > > >If my solution gets higher marks that others that use a const string, > >please send me the fee instead. Jens can go hungry. > > D3 DCC32 will not compile that without the addition of () as shown > below. > > var mystring : string ; index : integer ; > begin > if not (myString[index] in ['0'..'9']) then ; > end. > > Any survivors of the D3 DCC32 development team may care to consider > whether compiling that should give this : > $$5566.pas(4) Fatal: Internal error: C1376 > > But following the begin with myString := 'fffff' ; index := 3 ; > gives a good compile. > > -- > � John Stockton, Surrey, UK. jrs@merlyn.demon.co.uk D3 Turnpike v4 MIME. � > <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links; > <URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ; > <URL:http://www.borland.com/newsgroups/guide.html> news:borland.* Guidelines
Technical Details
Message-ID:
<3ddf5697@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!ngpeer.news.aol.com!newsfeed1.bredband.com!bredband!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mailReferences:
<3ddddf95$1@newsgroups.borland.com> <3dddf0e7@newsgroups.borland.com> <3dddff49@newsgroups.borland.com> <vg53EoBTFp39EwCM@merlyn.demon.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 109d30,309aca370994f001 X-Google-Attributes: gid109d30,public X-Google-ArrivalTime: 2002-11-23 03:15:33 PST Reply-To: "Martin Potokar" <gomfp@hotmail.com> From: "Martin Potokar" <gomfp@hotmail.com> Newsgroups: borland.public.delphi.language.objectpascal References: <3ddddf95$1@newsgroups.borland.com> <3dddf0e7@newsgroups.borland.com> <3dddff49@newsgroups.borland.com> <vg53EoBTFp39EwCM@merlyn.demon.co.uk> Subject: Re: How to check if a string value contains a numeric character Date: Sat, 23 Nov 2002 04:25:45 -0600 Lines: 57 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 65.176.144.59 Message-ID: <3ddf5697@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1038046871 65.176.144.59 (23 Nov 2002 02:21:11 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!ngpeer.news.aol.com!newsfeed1.bredband.com!bredband!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail