Lazarus

Using the Lazarus IDE => General => Topic started by: demosthenesk on September 29, 2022, 11:09:54 am

Title: How to RUN Console programs from Lazarus ?
Post by: demosthenesk on September 29, 2022, 11:09:54 am
Hello,
i am learning Free Vision and i write console apps.

When i press RUN from lazarus ide the program starts but it does not show up in terminal.
I use Ubuntu Linux and i ask help to show up the running app in a terminal console.

I can pause and stop program but not show the console.
How can i RUN console programs from Lazarus ?
Title: Re: How to RUN Console programs from Lazarus ?
Post by: demosthenesk on September 29, 2022, 11:20:30 am
ok i found the solution

https://wiki.freepascal.org/Console_Mode_Pascal

Title: Re: How to RUN Console programs from Lazarus ?
Post by: MarkMLl on September 29, 2022, 11:33:54 am
OK, I see you've found the solution but a few extra points.

First, when asking about something please put the version numbers of the tools you're using (i.e. Lazarus, FPC) in the body of your message. Also pertinent info about your OS.

Second, you've probably seen from that wiki page that there's a console output window which you can use while debugging. However it really is very basic with no support for cursor-positioning escape sequences and so on.

An alternative way is to start the program from a shell session, then to use the IDE's Run -> Attach to program... to connect the debugger to the program. That gives you the best of both worlds, since you'll have properly-formatted output but also breakpoints etc.

MarkMLl

p.s. RUN isn't an acronym, you don't have to capitalise it :-)
Title: Re: How to RUN Console programs from Lazarus ?
Post by: marcov on September 29, 2022, 11:39:25 am
(Maybe lazarus also have options to execute using another terminal program ? If so, try to run it with xterm, it generally was the most compatible terminal emualtor)
TinyPortal © 2005-2018