I develop (or pretend to develop) GUI applications, typically on my Mac with Lazarus Pascal.
If possible, I recompile the application under Windows and/or Linux.
One thing that has been annoying me it the lack (of knowledge on my end) of a simple way to output little debug text lines, so I can track certain things easier when debugging my application.
I've seen quite a lot of methods, but found (after some playing) that this works best for me:
1. Open a Terminal window and type:
tty
Which will show something like this:
/dev/ttys000
2. In Lazarus go to "Tools" - "Options" - "Debugger" - "General" and enter this value (/dev/ttys000) in the "ConsoleTty" field.
Now every "Write" and "WriteLn" output will be displayed in this terminal window.
If you do not have a terminal window open, the write(ln) statements will silently fail.
Note : The Terminal window MUST be OPEN before you run you application from the IDE, in order to see any messages.
Tip : It's not a bad idea to use compiler directives to enable/disable these writeln statements:
{$DEFINE DebugToConsole}
...
{$IFDEF DebugToConsole} Writeln('Debug informatie'); {$ENDIF}
You disable {$DEFINE DebugToConsole} by commenting them out:
// {$DEFINE DebugToConsole}