Recent

Author Topic: ANSI and ASCII Editor file in pascal(or py)?  (Read 913 times)

d-_-b

  • New Member
  • *
  • Posts: 35
ANSI and ASCII Editor file in pascal(or py)?
« on: April 12, 2020, 10:13:35 pm »
Hi

I wonder if there is any terminal wizard lurking on the forums? I have a artist using moebius ansi editor to create the picture you see on the left.

But if i use the below pascal or attache python code in the pic my result is what you see on the right.

What am i doing wrong? I'm using mobaxterm on win10 and stuff like cmatrix and pipes.sh renders correctly.

So how must i change my pascal code to get the ansi like output of moebius?

The medtricorder.ans file can be found here

Code: Pascal  [Select][+][-]
  1. program ansview;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses Process, SysUtils, Classes;
  6. var s: ansistring = '';
  7.   strs: TStringList;
  8. begin
  9.   strs := TStringList.Create;
  10.   try
  11.     strs.LoadFromFile('data/medtricorder.ans');
  12.     writeln(strs.text);
  13.     //if RunCommand('/bin/bash', ['-c', format('echo %s', [strs.text] ) ], s) then writeln(s)
  14.   finally
  15.     strs.free;
  16.   end;
  17. end.
  18.  
Code: Pascal  [Select][+][-]
  1. mov     ax,0013h
  2. int     10h
Denthor thanks for the vga programming tutorials | Download all tutorials

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1431
  • Former Delphi 1-7, 10.2 user
Re: ANSI and ASCII Editor file in pascal(or py)?
« Reply #1 on: April 13, 2020, 03:31:33 am »
Character set/codepage issue? See here which may be of help.
Lazarus 2.1 r65061 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r65070 FPC 3.3.1 r49223 macOS 11.2.3 aarch64 Xcode 12.4
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

 

TinyPortal © 2005-2018