Console() question...

Everything else that doesn't fall into one of the other PB categories.
mocitymm
User
User
Posts: 37
Joined: Wed Feb 08, 2017 6:56 pm

Console() question...

Post by mocitymm »

I am attempting to convert a current Pascal GUI based project running on Linux desktops (KDE/Gnome) to a text ui for Linux servers without X Windows... I thought of PureBasic for the second phase of this project. However it's been so long since I've dealt with any of the coding for 'text' interface (using crt, background color, text color, positioning, etc - old Turbo Pascal stuff).

Does anyone know of a code example(s) that they can point me to or share, that would include a simple text menu bar along the top, otherwise I will continue with Pascal.

I've searched on the forum board but, I guess I am not using the right criteria to find what I am looking for. I would like to use PureBasic and see the size of the binary smaller and faster but, if not... that is the way things go.

Regards,
-M
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Re: Console() question...

Post by Marc56us »

mocitymm wrote:I am attempting to convert a current Pascal GUI based project running on Linux desktops (KDE/Gnome) to a text ui for Linux servers without X Windows... I thought of PureBasic for the second phase of this project. However it's been so long since I've dealt with any of the coding for 'text' interface (using crt, background color, text color, positioning, etc - old Turbo Pascal stuff).

Does anyone know of a code example(s) that they can point me to or share, that would include a simple text menu bar along the top, otherwise I will continue with Pascal.

I've searched on the forum board but, I guess I am not using the right criteria to find what I am looking for. I would like to use PureBasic and see the size of the binary smaller and faster but, if not... that is the way things go.
Hi mocitymm,

You can write text applications in PB using the Console lib.
It has two modes: text (B&W) and graphics, which as the name doesn't indicate is also a text console.
The difference between the two is that the graphic mode allows you to position the cursor anywhere and use colors.
There are (to my knowledge) no ready-made libs like TurboVision (the 'old coders' of Borland Pascal and Borland C remember them).
:arrow: So we'll have to build an entire menu system. But we used to (30 years ago)
However, now we don't have the concept of screen memory pages as we had at the time (4 pages 80x25 if I remember), but we can compensate for this with the speed of today's CPUs.

:!: I also don't think it's possible to use the mouse in console mode like we did under DOS with interruption 33.

The Console in PB
https://www.purebasic.com/documentation ... index.html

Example of what it can do
https://www.purebasic.com/documentation ... le.pb.html

Now, it won't be efficient in terms of productivity, but it's a good exercise to reactivate our old neurons.

Enjoy
8)
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Console() question...

Post by #NULL »

FWIW, I made a little console game once, but no GUI and no color:
viewtopic.php?f=16&t=43768
This questions has been asked before, search forum for ncurses for example. But don't know if there is a ready solution like an ncurses binding.
mocitymm
User
User
Posts: 37
Joined: Wed Feb 08, 2017 6:56 pm

Re: Console() question...

Post by mocitymm »

Thanks Marc56us and #NULL,

I never thought that my programming would take me into the Linux arena but, I am in it now so... from what I can gather this is a dead end at this point (time constraints to project) so, I am gonna punt and drop back to the freepascal framework and use that for now.

If time permits (later) I can revisit and see what can be done... sounds like a challenge for a later date.

Regards,
-M
Post Reply