🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #32542

Using constants & in

#32542
From: Stephen Froude
Date: Fri, 22 Nov 2002 11:51
13 lines
1477 bytes
Can anyone tell me why this if statement always return False?

  if (qryStatus.FieldByName('oldstatus').AsInteger in [STATUS_NEW..STATUS_CANCELLED]) then

where STATUS_NEW & STATUS_CANCELLED are constants declared as

STATUS_NEW: Integer = 100;
STATUS_CANCELLED: Integer = 1000;

I've descovered that the AsInteger property returns a LongInt so tried copyying the value into a local Integer variable but it still returns False.

However if I substitute the constants for their values the if statement returns True.
Technical Details
Message-ID: <3dde1a3b$1@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-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!fr.usenet-edu.net!usenet-edu.net!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109d30,1c6f6604b711dd81,start
X-Google-Attributes: gid109d30,public
X-Google-ArrivalTime: 2002-11-22 04:15:45 PST
From: "Stephen Froude" <sfroude@teleplan-uk.c0m>
Sender: "Stephen Froude" <sfroude@teleplan-uk.c0m>
Reply-To: "Stephen Froude" <sfroude@teleplan-uk.c0m>
Subject: Using constants & in
Newsgroups: borland.public.delphi.language.objectpascal
X-User-Info: 193.130.174.58 193.130.174.58    
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3dde1a3b$1@newsgroups.borland.com>
Date: 22 Nov 2002 03:51:23 -0800
X-Trace: newsgroups.borland.com 1037965883 207.105.83.65 (22 Nov 2002 03:51:23 -0800)
Lines: 13
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!fr.usenet-edu.net!usenet-edu.net!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail