Board index » delphi » ANSI Output

ANSI Output

I am hoping somebody will have a small sample program that illustrates
ANSI output, eg using ANSi sequences to clearscreen, set textcolor,
position cursor at specific locations etc. In other words, I am trying
to emulate some of the functionality of the CRT unit.

Why? I admit it, I am being a traitor and will be teaching my students
introductory programming using CodeWarrior. That wondrous piece of
software doesn't have this capability. You need to use the GUI calls
which are too cumbersome and complicated for the newbie programmers.

Any help grealy appreciated. Target platform will be NT, do I need to
load ANSI.SYS as well?

Regards,

Keith S.

PS. have also posted this on various other newsgroups for max exposure

 

Re:ANSI Output


Hi ...

What are they programming in? pascal or ..

-woody^dsd

 http://www.come.to/cib

Quote
Keith Simpson wrote:
> I am hoping somebody will have a small sample program that illustrates
> ANSI output, eg using ANSi sequences to clearscreen, set textcolor,
> position cursor at specific locations etc. In other words, I am trying
> to emulate some of the functionality of the CRT unit.

> Why? I admit it, I am being a traitor and will be teaching my students
> introductory programming using CodeWarrior. That wondrous piece of
> software doesn't have this capability. You need to use the GUI calls
> which are too cumbersome and complicated for the newbie programmers.

> Any help grealy appreciated. Target platform will be NT, do I need to
> load ANSI.SYS as well?

> Regards,

> Keith S.

> PS. have also posted this on various other newsgroups for max exposure

Re:ANSI Output


In article <369EB02A.2...@uws.edu.au>,
Keith Simpson  <k.simp...@uws.edu.au> wrote:

Quote
>I am hoping somebody will have a small sample program that illustrates
>ANSI output, eg using ANSi sequences to clearscreen, set textcolor,
>position cursor at specific locations etc. In other words, I am trying
>to emulate some of the functionality of the CRT unit.

const esc=#27;

procedure GotoXY(X,Y: Byte);
var m1,m2:string[3];
begin
  str(X,m1);
  str(Y,m2);
  Write(esc+'['+m2+';'+m1+'H');
end;

procedure ClrScr;
Begin
 Write(esc+'[H'+esc+'[2J');
end;

procedure ClrEol;
Begin
  Write(esc+'[K');
end;

{ these two do not work with standard ANSI.SYS}

procedure InsLine;
Begin
  Write(esc+'[L');
end;

procedure DelLine;
Begin
  Write(esc+'[M');
end;

Osmo

Re:ANSI Output


You can get most of the ESC codes (and all ones which work with ANSI.SYS) by
looking in the
a) MS-DOS 5.0 manual
b) MS-DOS 6.xx online-help
c) Win95-CDROM (there is a dir named OLDMSDOS which contains the online
help).

And yes, ANSI.SYS has to be loaded.

DEVICEhigh=C:\DOS\ANSI.SYS
or
DEVICEhigh=C:\WINDOWS\COMMAND\ANSI.SYS

(assuming standard locations).

When you write a mailbox server (or telnet???) you don't need ANSI.SYS . The
remote terminal program will do ANSI.SYS's work.

Other Threads