[Lazarus] Example of full screen console program anywhere?

Bo Berglund bo.berglund at gmail.com
Thu Apr 28 15:23:01 CEST 2016


On Mon, 25 Apr 2016 16:59:25 +0200, Bo Berglund
<bo.berglund at gmail.com> wrote:

>I need to create a console program, but one that works similar to the
>nano editor, the gpsd position/satellite view or raspi-config on a
>Raspberry Pi.
>I.e. the program manages the full terminal screen and displays its
>data in certain areas on screen and reads keystrokes as commands for
>controlling the program.
>I once did such programs on Windows using BASIC, but that was before
>Windows appeared and I have all but forgotten how it was actually
>accomplished....
>So I am looking for some examples to start off where the cursor for
>writing is positioned on the screen in order to put output data in
>certain places and commands can be entered without moving the
>displayed screen.
>
>Is there such an example for FPC/Lazarus available somewhere?
>Target is Raspbian on a Raspberry Pi3 and I cannot use any GUI system
>for this because it must be accessed remotely via SSH (PuTTY) over a
>slow link that does not work decently with the graphical interface.
>
Just to clarify:
I want to be able to run an FPC program in the console of an SSH
terminal like PuTTY connected to the remote system (a Raspberry Pi3
sitting across the world from me).
This program should have 4-5 commands via key entries where it
activates certain combinations of GPIO output pins to control relays,
which in turn power on certain devices connected to the RPi
controller.

I have a GUI program created with Lazarus 1.6 and FPC 3.0.0 where I
have located almost all of the actual processing in separate classes.
I *can* run the GUI program on the remote Pi via VPN and then TightVNC
but it is a PITB because of the sluggish response due to the slow
connection to there from here.

So I want to make a console type program instead which continuously
displays the state of the GPIO outputs (like I have GUI shapes which
change color) and then reacts to key presses where single letters mean
different things causing an action on the outputs.

What I do not want is a program that scrolls up on the screen as keys
are entered etc. I want the screen to stay put and only the status
fields change when I do the commands.

Your two responses have been a bit over the top of my head in this
context.
I should have formulated my request a bit clearer of course.
For example comparing to the nano editor was a bit over the top. :(


-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list