I can't find debug window,how to show console lazarus / 12-Debugger ---------------------------------------------------------------------- vkhoa · 2014-06-22 01:36 otherwise how can I show (and hide) the console window currently, I use a memo to display string but when error occur, I can't view the debug string I added before the error line, is console window can be viewed when error occur ---------------------------------------------------------------------- Rails · 2014-06-22 02:18 View/Debug Windows/Terminal Output. ---------------------------------------------------------------------- Martin_fr · 2014-06-22 03:45 On Windows, just uncheck "GUI app" in the project options. Console depends on haw the app is build. On linux, use the debug window. On Mac there is none, see the wiki "console debugging" ---------------------------------------------------------------------- Leledumbo · 2014-06-22 04:53 alternatively on Windows, run with --debug-log=path\to\logfile.txt.  See: http://wiki.freepascal.org/IDE_tricks#DebugLn_of_the_IDE_or_a_LCL _application ---------------------------------------------------------------------- vkhoa · 2014-06-23 09:02 @Rails, I didn't find View/Debug Windows/Terminal Output but View/Debug Windows/debug Output , anyone can answer how to write to it @ Martin_fr, I have looked for the "GUI app" in project options but found nothing, and another question,can I see the console when error occur,I want to use it to debug  the program @leledumbo, I have add '--debug-log=mylog.txt' to the lazarus shortcut, reopen lazarus ,run the program then opened mylog.txt but didn't see the text from debugln,the file is like to be interrupted, it end with: Code: [Select][TMainIDE.DoRunProject] INIT TMainIDE.DoInitProjectRun Check build ... TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Last= -Fu.  -MObjFPC -Scghi -O1 -g -gl -vewnhi -l fcllaz.pas TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Last= -Fu..\..\packager\units\i386-win32;.  -MObjFPC -Scghi -O1 -g -gl -vewnhi -l lazutils.pas TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Last= -MObjFPC -Scghi -O1 -g -gl -vew -l -Fuforms;widgetset;;..\packager\units\i386- win32;..\components\lazutils\lib\i386-win32;. -Fiinclude alllclunits.pp TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile Last= -MObjFPC -Scghi -O1 -g -gl -vewnhi -l -Fuwin32;..\..\packager\units\i386- win32;..\..\components\lazutils\lib\i386-win32;..\units\i386-win32;. -Fiwin32 lcl.pas TMainIDE.DoBuildProject MainBuildBoss.DoCheckIfProjectNeedsCompilation nothing to be done TMainIDE.DoInitProjectRun ProgramFilename=D:\mydocument\_lazarus\kmath\math1.exe [TMainIDE.DoRunPr ---------------------------------------------------------------------- Mike.Cornflake · 2014-06-23 09:11 There used to be a GExperts plugin for Delphi 7 that I used extensively.  Would love something similar. Quote@Rails, I didn't find View/Debug Windows/Terminal Output but View/Debug Windows/debug Output , anyone can answer how to write to it I'd love to know as well... Quote@leledumbo, I have add '--debug-log=mylog.txt' to the lazarus shortcut, reopen lazarus ,run the program then opened mylog.txt but didn't see the text from debugln,the file is like to be interrupted, it end with:Wierd.  Because my suggestion was going to be run an equivalent of Tail pointing to that file :-( ---------------------------------------------------------------------- taazz · 2014-06-23 09:13 Quote from: vkhoa on June 23, 2014, 11:02:40 am@ Martin_fr, I have looked for the "GUI app" in project options but found nothing, and another question,can I see the console when error occur,I want to use it to debug  the program see attached screen shot. ---------------------------------------------------------------------- vkhoa · 2014-06-23 10:22 thank you all ! Now I can write text to the console ---------------------------------------------------------------------- Rails · 2014-06-23 10:43 Quote from: vkhoa on June 23, 2014, 11:02:40 am@Rails, I didn't find View/Debug Windows/Terminal Output but View/Debug Windows/debug Output , anyone can answer how to write to it Sorry, I forget there are some IDE differences between Linux and Windows. I am on Linux. Just write to it using WriteLn or DebugLn. You will need LazLogger in the unit's uses clause for DebugLn. Change LazLogger to lazLoggerDummy to suppress the output. ---------------------------------------------------------------------- vkhoa · 2014-06-23 10:54 both writeln and debugln write to console, not the debug output ---------------------------------------------------------------------- BigChimp · 2014-06-23 11:06 AFAIR, you can direct writeln to write out to stderr, perhaps something like this (untested, shamelessly adapted from http://bugs.freepascal.org/view.php?id=17346) Code: [Select]Var   hstderr : ^text; begin   hstderr:=@stderr;   Writeln(hstderr^,'This should be stderr.'); end; ---------------------------------------------------------------------- Rails · 2014-06-23 11:53 Quote from: vkhoa on June 23, 2014, 12:54:46 pmboth writeln and debugln write to console, not the debug output I just tried WriteLn and DebugLn with laz 1.2.4 Windows version running under Wine. They wrote to Debug Output.