[Lazarus] WriteLn back to the GUI

Sven Barth pascaldragon at googlemail.com
Wed Oct 23 20:46:08 CEST 2013

On 23.10.2013 19:39, ListMember wrote:
> On 2013-10-23 18:55, Michael Van Canneyt wrote:
>> On Wed, 23 Oct 2013, ListMember wrote:
>>>> And I just found an example which already does this for TCustomEdit
>>>> descendants: http://kd5col.info/swag/DELPHI/0017.PAS.html
>>>> I've not tested it in FPC, so maybe small adjustments might be
>>>> necessary...
>>> Wow.
>>> This is far too (incredibly) elaborate.
>>> It's a bit like giving me plans to set up an army to invade a country
>>> when all I want to do is to visit it as a tourist :)
>>> As I mentioned in my first post, I am prepared to alter the compiler
>>> sources;
>> And this you consider not elaborate? That's a nice one :)
> :)
> Actually, since this is FPC/Lazarus we're talking about (which means,
> thankfull NOT Delphi), you guys have made it relatively easy to
> re-compile both FPC and Lazarus.
> And, since all I want to do is a very small surgical alteration, I'd say
> --given the above-- doing this is not elaborate at all.

"Writeln" is a complex functionality. So you should better trust us 
(hint: I'm a compiler developer) when we say this is more difficult than 
you imagine.

>> As I wrote in my post: See the CRT unit.
>> It does exactly that. You need maybe 20 lines of code to do as you want.
> Will do, thanks.
> But, let me ask this:
> If I used the CRT unit, would I need to add it to every single unit in
> the project that uses WriteLn?

Michael did not say that you should use the CRT unit, but that the unit 
implements something similar and that you should take a look at it to 
implement your own variant of it.
And then you need to include your own unit only once (e.g. either you 
put the "hooking" into the initialization section or you do it at the 
start of your program)


More information about the Lazarus mailing list