Re: Great compiler bug! - Comparing events.
From: Martin Harvey (Demon Account) (martin_at_pergolesi.demon.co.uk)
Date: 10/12/03
- Next message: Martin Harvey (Demon Account): "Re: So Delphi can't do this ..."
- Previous message: Brian Cook: "Re: So Delphi can't do this ..."
- In reply to: Marjan Venema: "Re: Great compiler bug! - Comparing events."
- Next in thread: Andrew Cruickshank: "Re: Great compiler bug! - Comparing events."
- Reply: Andrew Cruickshank: "Re: Great compiler bug! - Comparing events."
- Reply: Peter Below (TeamB): "Re: Great compiler bug! - Comparing events."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 12 Oct 2003 19:02:42 +0100
On Sun, 12 Oct 2003 19:28:48 +0200, Marjan Venema
<info@bjmsoftware.OhNoNotThis.com> wrote:
>>Unfortunately, the line "if @Event1 = @Event2 then" doesn't compare
>>the entire event, it only compares the code pointers. Oops!
>
>Sunday night may have dampened my brain's efficiency, but why do you
>expect Delphi to compare entire events when you specifically request
>address pointers with the @?
>
Because function and method pointers are the one situation where @
does *NOT* mean take the address of".
Doing:
"if Event1 = Event 2 then" means: "Call both function pointers and
compare the result"
"if @Event1 = @Event 2 then" means: "Compare the value of both
function pointers"
and
"if @@Event1 = @@Event 2 then" means: "Compare the address of both
function pointers"
It's in the OP language guide.
MH.
- Next message: Martin Harvey (Demon Account): "Re: So Delphi can't do this ..."
- Previous message: Brian Cook: "Re: So Delphi can't do this ..."
- In reply to: Marjan Venema: "Re: Great compiler bug! - Comparing events."
- Next in thread: Andrew Cruickshank: "Re: Great compiler bug! - Comparing events."
- Reply: Andrew Cruickshank: "Re: Great compiler bug! - Comparing events."
- Reply: Peter Below (TeamB): "Re: Great compiler bug! - Comparing events."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|