Re: Great compiler bug! - Comparing events.
From: Andrew Cruickshank (andrew_at_openkast.com)
Date: 10/12/03
- Next message: Rob Kennedy: "Re: So Delphi can't do this ..."
- Previous message: Matthias Matting: "Re: Exchanging bitmaps with DLL?"
- In reply to: Martin Harvey (Demon Account): "Re: Great compiler bug! - Comparing events."
- Next in thread: Peter Below (TeamB): "Re: Great compiler bug! - Comparing events."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 12 Oct 2003 21:18:54 +0100
Martin Harvey (Demon Account) wrote:
> 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".
>
The OPLG also only says that "@" operator gets the address
of the function or procedure.
You can read it both ways by implication:
(a) that it will return the instance + method pointer value (64 bits)
or
(b) that it will return the method pointer only (32 bits)
It looks like the compiler goes with (b). Arguably not a bug. However
it's a nasty little language hack IM(NV)HO.
--------------
Andrew.
- Next message: Rob Kennedy: "Re: So Delphi can't do this ..."
- Previous message: Matthias Matting: "Re: Exchanging bitmaps with DLL?"
- In reply to: Martin Harvey (Demon Account): "Re: Great compiler bug! - Comparing events."
- Next in thread: Peter Below (TeamB): "Re: Great compiler bug! - Comparing events."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|