[fpc-pascal] fpsystem output

Michael Van Canneyt michael at freepascal.org
Tue Jan 15 13:55:50 CET 2013



On Tue, 15 Jan 2013, Rainer Stratmann wrote:

> Am Tuesday 15 January 2013 13:41:19 schrieb Mark Morgan Lloyd:
>> Rainer Stratmann wrote:
>>>> in order to do it's magic, CRT must control the terminal.
>>>
>>> Are there alternative ways to write something on the screen and to clear
>>> the screen?
>>> For example with unit system?
>>
>> In the general case, that's going to be terminal-specific. If you only
>> want stdout (and/or stderr) output you'd need to know what escape
>> sequence to sent to the terminal (possibly with reference to
>> termcap/terminfo- I don't know whether there are libraries to handle
>> this) but if you wanted full control like you get with the FP IDE I
>> think you'd be using the old TurboPower stuff.
>>
>> In extremis, if you're already invoking an external program and want to
>> clear output after it runs, and if you know that you're running on a
>> unix, you could simply invoke the clear program.
>>
>> Going back to your original question, I see no reason why you couldn't
>> open and parse e.g. /proc/partitions as an ordinary text file.
>
> This is one thing.
> Another thing are the error messages from freepascal which behave the same
> then.
> And other output messages (for example dhcp service programs).
>
> Isn't it possible to make a function in crt that makes the behaviour wanted?
> Something like crt.turn_linefeed_on(); or similar.

No, it is not.

CRT is simply not meant to be mixed with raw output, and definitely not from other programs.
There would be no end to the number of problems.

Michael.



More information about the fpc-pascal mailing list