Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-03

Console app

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Richard Mace

Hi All,
I have never written a console app and was wondering 2 things. Firstly, if I was to write an app that doesn't require a GUI, that runs on both Windows and Linux (with no XServer) is that classed as a console app? And secondly, is it fairly straight forward to write a console app that stores and retrieves data from a Firebird database, on the basis that I want to be able to use either the standard Lazarus components (or Zeos) to talk to the database?

Thanks in advance

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140315/55349127/attachment.html>

Reply by email

Reinier Olislagers
to Richard Mace
Richard Mace wrote
I have never written a console app and was wondering 2 things. Firstly, if I was to write an app that doesn't require a GUI, that runs on both Windows and Linux (with no XServer) is that classed as a console app?

Yes, it would.

And secondly, is it fairly straight forward to write a console app that stores and retrieves data from a Firebird database, on the basis that I want to be able to use either the standard Lazarus components (or Zeos) to talk to the database?

Well, they're standard FPC components[1] rather than Lazarus components then... (So follow up questions probably belong on the FPC list rather than the Lazarus one)

See
http://wiki.lazarus.freepascal.org/Database_bug_reporting#FreePascal for a simple example, but you can work with queries etc just as you're used to with Lazarus

[1] FPC's sqldb, which is also used by Lazarus GUI components

Reply by email

Mattias Gaertner
to Richard Mace: I have never written a console app and was wondering 2 things. Firstly, if I was to write…
Hi All, I have never written a console app and was wondering 2 things. Firstly, if I was to write an app that doesn't require a GUI, that runs on both Windows and Linux (with no XServer) is that classed as a console app?

Yes.

And secondly, is it fairly straight forward to write a console app that stores and retrieves data from a Firebird database, on the basis that I want to be able to use either the standard Lazarus components (or Zeos) to talk to the database?

Yes.

Mattias

Reply by email

Michael Schnell
to Richard Mace: I have never written a console app and was wondering 2 things. Firstly, if I was to write…
Richard Mace wrote 10 lines
Hi All, I have never written a console app and was wondering 2 things. Firstly, if I was to write an app that doesn't require a GUI, that runs on both Windows and Linux (with no XServer) is that classed as a console app? And secondly, is it fairly straight forward to write a console app that stores and retrieves data from a Firebird database, on the basis that I want to be able to use either the standard Lazarus components (or Zeos) to talk to the database?

A problem might be that there (right now) is no "Widget Type" in Lazarus, that has no GUI binding and allows for using stuff like TTimer, TThread.Synchronize, TThread.Queue and QueuAsyncCall().

In fact I am planning to do such a Widget Type, but unfortunately I currently am busy with unrelated things.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140317/aa33af7c/attachment.html>

Reply by email

Bart
to Michael Schnell
Michael Schnell wrote
A problem might be that there (right now) is no "Widget Type" in Lazarus, that has no GUI binding and allows for using stuff like TTimer, TThread.Synchronize, TThread.Queue and QueuAsyncCall().

The NoGUI WS doesn't allow this?

Bart

Reply by email

Mattias Gaertner
to Bart: The NoGUI WS doesn't allow this? Bart
Show quoted text 7 lines
On 3/17/14, Michael Schnell wrote: > A problem might be that there (right now) is no "Widget Type" in > Lazarus, that has no GUI binding and allows for using stuff like TTimer, > TThread.Synchronize, TThread.Queue and QueuAsyncCall(). The NoGUI WS doesn't allow this?

The NoGUI has not implemented it.
Feel free to add it.

Mattias

Reply by email

Michael Schnell
to Mattias Gaertner
Mattias Gaertner wrote
Feel free to add it.

It's not as impossible as I initially thought, as the fpc RTL already provides the basic Queue implantation that can be used (while all other "active" Widget Types use a queue provided by the GUI infrastructure they attach to).

Doing TTimer needs some afterthoughts: there are multiple ways, each with some pro's and cons: e.g.
- simply using the "timeout" parameter of the RTL queue "poll" procedure,
- doing one or several dedicated threads with "sleep()" for handling the timers, feeding timer events into the queue
- ...

-Michael

Reply by email

Richard Mace
to Michael Schnell: A problem might be that there (right now) is no "Widget Type" in Lazarus, that has no GUI…

I have never written a console app and was wondering 2 things.

Show quoted text 11 lines
Firstly, if I was to write an app that doesn't require a GUI, that runs on both Windows and Linux (with no XServer) is that classed as a console app? And secondly, is it fairly straight forward to write a console app that stores and retrieves data from a Firebird database, on the basis that I want to be able to use either the standard Lazarus components (or Zeos) to talk to the database? A problem might be that there (right now) is no "Widget Type" in Lazarus, that has no GUI binding and allows for using stuff like TTimer, TThread.Synchronize, TThread.Queue and QueuAsyncCall().

Ah, yes. That would be ab issues as using a TTimer would be essential for what I am planning :(

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140317/2889e993/attachment.html>

Reply by email