Article View: borland.public.delphi.language.objectpascal
Article #32474Re: Using constants & in
From: Brendan Bosman
Date: Fri, 22 Nov 2002 12:57
Date: Fri, 22 Nov 2002 12:57
48 lines
2011 bytes
2011 bytes
I think it is a BUG!!
because this work:
const
STATUS_NEW = 100;
STATUS_CANCELLED = 1000;
var
iStatus: Integer;
begin
iStatus := 370;
case iStatus of
STATUS_NEW..STATUS_CANCELLED:
begin
ShowMessage('Hello');
end;
end;
end;
"Stephen Froude" <sfroude@teleplan-uk.c0m> wrote in message
news:3dde25a1$1@newsgroups.borland.com...
>
> This is strange. If I run the following code, the for loop breaks on 233.
Why does this happen??? I'm using Delphi 6 Ent
>
> procedure TForm1.Button1Click(Sender: TObject);
> const
> STATUS_NEW: Integer = 100;
> STATUS_CANCELLED: Integer = 1000;
> var
> iLoop, iStatus: Integer;
> begin
> for iLoop:= STATUS_NEW to STATUS_CANCELLED do
> begin
> iStatus := iLoop;
> if not (iStatus in [STATUS_NEW..STATUS_CANCELLED]) then
> begin
> ShowMessage('Failed on ' + IntToStr(iStatus));
> Break;
> end;
> end;
> end;
Technical Details
Message-ID:
<3dde2a30$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!out.nntp.be!propagator-SanJose!news-in-sanjose!in.nntp.be!caladan.arrakis.es!newsgroups.borland.com!not-for-mailReferences:
<3dde1a3b$1@newsgroups.borland.com> <3dde1f33@newsgroups.borland.com> <3dde25a1$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109d30,1c6f6604b711dd81 X-Google-Attributes: gid109d30,public X-Google-ArrivalTime: 2002-11-22 05:30:19 PST From: "Brendan Bosman" <brendan.bosman@syssol.ie> Newsgroups: borland.public.delphi.language.objectpascal References: <3dde1a3b$1@newsgroups.borland.com> <3dde1f33@newsgroups.borland.com> <3dde25a1$1@newsgroups.borland.com> Subject: Re: Using constants & in Date: Fri, 22 Nov 2002 12:57:39 -0000 Lines: 50 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: 213.105.178.230 Message-ID: <3dde2a30$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1037969968 213.105.178.230 (22 Nov 2002 04:59:28 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!out.nntp.be!propagator-SanJose!news-in-sanjose!in.nntp.be!caladan.arrakis.es!newsgroups.borland.com!not-for-mail