Re: [fpc-pascal] will be work macro with name of the unit?

2015-07-15 Thread Michael Van Canneyt
On Tue, 14 Jul 2015, ulrich wrote: Hi, I have this unit, but when I compile it, I get this error: Illegal unit name XXX_Parser. The unit is saved under dfm_rrparser.pas. The unit name must always match the file name. This is logical, because otherwise the compiler can never find it if a

Re: [fpc-pascal] will be work macro with name of the unit?

2015-07-15 Thread Pierre Free Pascal
{$IFDEF FPC} {$MACRO ON} {$IFNDEF XXX_} {$DEFINE XXX_:=DFM_RR} // replace prefix {$ENDIF} {$ENDIF} {$INFO compiled with XXX_} unit XXX_parser; {$mode objfpc}{$H+} interface implementation end. Macros are only expanded on whole tokens (aka words). So

Re: [fpc-pascal] question with interfaces, hooks

2015-07-15 Thread Graeme Geldenhuys
On 2015-07-15 10:21, Sven Barth wrote: The property could even be protected or private and it should still work as long as the containing class has the interface in its parent list. I thought that would only work if you access the method via an interface variable, not a class instance

Re: [fpc-pascal] question with interfaces, hooks

2015-07-15 Thread Sven Barth
Am 15.07.2015 09:27 schrieb Graeme Geldenhuys mailingli...@geldenhuys.co.uk: On 2015-07-15 05:06, David Emerson wrote: So... since t_fancy_class implements the interface i_foo, why is t_fancy_class.foo not available? Because you told it a property named hook implements it, so you need to

Re: [fpc-pascal] will be work macro with name of the unit?

2015-07-15 Thread Sven Barth
Am 15.07.2015 08:21 schrieb ulrich rom...@cbox.cz: Hi, I have this unit, but when I compile it, I get this error: Illegal unit name XXX_Parser. The unit is saved under dfm_rrparser.pas. Second question: Why not displayed $INFO directive in the message window (I have enabled -vi switch in

Re: [fpc-pascal] question with interfaces, hooks

2015-07-15 Thread Graeme Geldenhuys
On 2015-07-15 05:06, David Emerson wrote: So... since t_fancy_class implements the interface i_foo, why is t_fancy_class.foo not available? Because you told it a property named hook implements it, so you need to call it as follows: fc.hook.foo; Regards, - Graeme - -- fpGUI Toolkit - a

[fpc-pascal] will be work macro with name of the unit?

2015-07-15 Thread ulrich
Hi, I have this unit, but when I compile it, I get this error: Illegal unit name XXX_Parser. The unit is saved under dfm_rrparser.pas. Second question: Why not displayed $INFO directive in the message window (I have enabled -vi switch in command line)? {$IFDEF FPC} {$MACRO ON}

Re: [fpc-pascal] question with interfaces, hooks

2015-07-15 Thread Sven Barth
Am 15.07.2015 06:07 schrieb David Emerson dle...@angelbase.com: [snip] constructor t_fancy_class.create; begin inherited; f_hook := t_foo_base.create; end; destructor t_fancy_class.destroy; begin t_foo_base(f_hook).free; inherited; end; [snip] Not related to

Re: [fpc-pascal] question with interfaces, hooks

2015-07-15 Thread Sven Barth
Am 15.07.2015 11:51 schrieb Graeme Geldenhuys mailingli...@geldenhuys.co.uk: On 2015-07-15 10:21, Sven Barth wrote: The property could even be protected or private and it should still work as long as the containing class has the interface in its parent list. I thought that would only