[lazarus] the party can start ;) (fwd)
Michael A. Hess
mhess at miraclec.com
Wed May 19 12:39:15 EDT 1999
Florian Klaempfl wrote:
>
> > Should I be able to do something like this?
> >
> > procedure DoClick; message 'click';
> >
> > I would love to be able to.
>
> This should be no problem, only if there is a compiler bug :).
Well here is what I get in the various scenarios.
1. procedure DoClick(var b: integer; Self: TMyControl);message 'click';
This compiles fine.
2. procedure DoCLick(Self: TMyControl);mesage 'click';
The compiler result is:
test.s: Assembler messages:
test.s:0: Warning: end of file not at end of a line; newline inserted
test.s:5: Error: Rest of line ignored. First ignored character valued
0x8.
test.s:6: Error: ignoring unrecognized symbol type ""
test.s:6: Error: Rest of line ignored. First ignored character valued
0x8.
test.s:7: Error: Rest of line ignored. First ignored character valued
0x8.
test.s:83: Error: Bad expression
test.s:83: Error: Rest of line ignored. First ignored character
valued 0x1b.
Warning: Error while assembling exitcode 1
Fatal: There were 1 errors compiling module, stopping
3. procedure DoClick;message 'click';
This results in:
Panic : Internal compiler error, exiting.
test.pp(7,26) Fatal: Internal error 9999
> The point is, that DispatchMsgStr doesn't know anything about the
> parameters of the message handler, so it assumes a standard method
> which gets one var parameter. Anything else leads into trouble!
That was my question in earlier emails. I couldn't understand why I was
required to set parameters for a message handler when DispatchStr
doesn't deal with them or know about them.
As you can see from my result above it requires MORE than the one
parameter. These results came from the sample code I had included in a
previous email.
> The reason for the explicit self parameter is, to allow
> passing that method directly as message handler to the gtk!!
I understand that and that would be nice except it isn't needed for what
I am doing.
--
==== Programming my first best destiny! ====
Michael A. Hess Miracle Concepts, Inc.
mhess at miraclec.com http://www.miraclec.com
More information about the Lazarus
mailing list