[fpc-pascal]Problems with "Write" and/or ANSI-Emulation from fpc
Martin
martinitram at t-online.de
Thu Jul 26 13:50:19 CEST 2001
hello...
i have problems with "Write" and/or ANSI-Emulation from fpc.
as first please take a look at my testing source:
----CUT------------CUT------------CUT------------CUT------------CUT------------CUT------
uses crt;
var
line : ansistring;
i : byte;
begin
writeln(#027,'[2J'); // ansi-sequence - clear screen
line := '1234567890abcdef';
for i:= 1 to length(line) do begin
write (#027, '[s'); // ansi-sequence - position save
write ('',ord(line[i]),''); // ansi-sequence - write data
write (#027, '[u'); // ansi-sequence - position restore
write (#027, '[4C'); // ansi-sequence - move cursor 4 tokens to the right
end;
end.
----CUT------------CUT------------CUT------------CUT------------CUT------------CUT------
the output of the program is exactly:
---------------------------------------------------------------------------
49 50 51 52 53 54 55 56 57 48 97
98 99 100 101 102
---------------------------------------------------------------------------
but why ? normaly the output must be:
---------------------------------------------------------------------------
49 50 51 52 53 54 55 56 57 48 97 98 99 100 101 102
---------------------------------------------------------------------------
has fpc an own ansi emulation in write/writlen procedures ?
if so, there is an bug in the ansi-code sequence/s "ESC[s" and/or "ESC[u".
on the standard linux console with the shell-command echo the output is 100% ok.
can you help me to fix this problem ?
More information about the fpc-pascal
mailing list