[Lazarus] WriteLn back to the GUI

Michael Van Canneyt michael at freepascal.org
Wed Oct 23 11:20:01 CEST 2013

On Wed, 23 Oct 2013, ListMember wrote:

> On 2013-10-23 11:33, Lukasz Sokol wrote:
>> On 23/10/13 07:59, ListMember wrote:
>>> Hello,
>>> I am trying to find where WriteLn is declared; but, apparently,
>>> WriteLn is among the select few that Lazarus will ignore 'Find
>>> Declaration' requests --at least that's how it behaves (latest
>>> Lazarus stable) on my side.
>>> My ultimate goal, after finding where it is declared, is to locally
>>> modify that part of the sources so that (instead of writing to the
>>> console) it will use a global callback to display whatever WriteLn'ed
>>> in a TMemo.
>>> Or, is there already an alternative to redirect console output to the
>>> running GUI?
>> DebugLn() ?
> I don't really want to alter the sources (which are more than 100 units).
> I'd rather find the unit where WriteLn() procedure is defined and alter it 
> once and recompile FPC/Lazarus.
> But, I just can't locate where WriteLn procedure is defined. I did a grep 
> (equivalent in Windows) but came up with nothing usable.

This routine does not exist. It is handled specially by the compiler.

What you must do is something similar to what the crt unit does, and assign() 
the input/output files to a special file handler.


More information about the Lazarus mailing list