[fpc-pascal]Passing Methods as Callback Procedures?
jueca at brturbo.com
Tue Dec 17 19:00:08 CET 2002
On Mon, 16 Dec 2002 20:23:34 +0000
Jon David Sawyer <badquanta6384 at comcast.net> wrote:
> > fCollection is a TCollection?
> > My TCollection does not have ForEach ;) (1.1 CVS 2002/12/13)
> Its in the docs ^_^ I dunno why you don't have it ^_^
I look at the sources, and, as you say that its in the docs, I look at tha docs too, but I don't find any ForEach...
But a grep show me that you are using TCollection of Objects.pp... :) and I was looking at classes.pp ;)
I don't know much about "objects".... :)
there is no "of object" in objects.pp
you are using TP compatible mode?
> FPC Compiles without complaints.. It doesn't even warn me that I'm
> intermixing Procedures of Object and Procedures; I had assumed this
> meant that it would work. I'm also using FPC Devel 1.1.
> As a fix I just created my own object that inherited from tCollection
> and accepted Procedure or Object as a callback. ^_^ It worked.. I just
> think the compiler should warn/fault on you if you make that kind of
> mistake ^_^
Well, it isn't with me :)
but, think about to use -S2 and use classes instead of objects.
More information about the fpc-pascal