Recent

Author Topic: [Solved] Linux, how to see WriteLn(???)  (Read 438 times)

BrunoK

  • Hero Member
  • *****
  • Posts: 756
  • Retired programmer
[Solved] Linux, how to see WriteLn(???)
« on: November 22, 2025, 01:50:27 pm »
I managed (with lots of pain, tried manjaro and others, but they do not handle multiscreen well and lots of other troubles like manjaro refusing to install on the external ssd) to install linux mint on a usb connected ssd. linux mint looks ok.

In lazarus  for windows run the following program :
Code: Pascal  [Select][+][-]
  1. program pgmInstanceSize;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}
  7.   cthreads,
  8.   {$ENDIF}
  9.   Classes
  10.   { you can add units after this };
  11.  
  12. var
  13.   vList: TList;
  14. begin
  15.   vList := TList.Create;
  16.   writeLn(TList.InstanceSize, ' ', vList.InstanceSize);
  17.   vList.Free;
  18.   ReadLn;
  19. end.      
and it displays

Quote
32 32
and wait for return.

In lazarus linux running this program doesn't show anything. What do I need to get the console to show the values and wait for return ?
« Last Edit: November 22, 2025, 04:04:41 pm by BrunoK »

cdbc

  • Hero Member
  • *****
  • Posts: 2531
    • http://www.cdbc.dk
Re: Linux, how to see WriteLn(???)
« Reply #1 on: November 22, 2025, 01:57:14 pm »
Hi
Menu -> 'View' -> 'Debug Windows' -> 'Console In/Output'
...or run a terminal in another desktop (or besides lazarus)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 690
Re: Linux, how to see WriteLn(???)
« Reply #2 on: November 22, 2025, 03:02:16 pm »
Also try Menu -> Run -> Run Parameters and check "Use Launching Application".   

BrunoK

  • Hero Member
  • *****
  • Posts: 756
  • Retired programmer
Re: Linux, how to see WriteLn(???)
« Reply #3 on: November 22, 2025, 03:16:51 pm »
Also try Menu -> Run -> Run Parameters and check "Use Launching Application".   
Thanks, but what should I put in those parameters ?

BrunoK

  • Hero Member
  • *****
  • Posts: 756
  • Retired programmer
Re: Linux, how to see WriteLn(???)
« Reply #4 on: November 22, 2025, 03:18:56 pm »
Hi
Menu -> 'View' -> 'Debug Windows' -> 'Console In/Output'
...or run a terminal in another desktop (or besides lazarus)
Regards Benny
Thanks, at least I can view the WriteLn'd values,

What about entering return on the ReadLn to terminate the program ?

cdbc

  • Hero Member
  • *****
  • Posts: 2531
    • http://www.cdbc.dk
Re: Linux, how to see WriteLn(???)
« Reply #5 on: November 22, 2025, 03:54:55 pm »
Hi
Quote
What about entering return on the ReadLn to terminate the program ?
Click on the 'Console in/output' window and press [Enter]
Btw. 'ReadLn' is not necessary on *nix, the terminal stays open...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

BrunoK

  • Hero Member
  • *****
  • Posts: 756
  • Retired programmer
Re: Linux, how to see WriteLn(???)
« Reply #6 on: November 22, 2025, 04:04:10 pm »
Hi
Quote
What about entering return on the ReadLn to terminate the program ?
Click on the 'Console in/output' window and press [Enter]
Btw. 'ReadLn' is not necessary on *nix, the terminal stays open...
Regards Benny
Ok, thank you, I did not expect the Console In/output not having the focus.

cdbc

  • Hero Member
  • *****
  • Posts: 2531
    • http://www.cdbc.dk
Re: [Solved] Linux, how to see WriteLn(???)
« Reply #7 on: November 22, 2025, 04:57:59 pm »
Hi
Quote
I did not expect the Console In/output not having the focus.
Yup, at first, that fact bit me on the ass constantly  :D ...Now I remember the click ;D
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

 

TinyPortal © 2005-2018