Article View: comp.os.msdos.misc
Article #2806Re: ANSI ESC sequence, how??
From: Ian Stuart
Date: Sat, 26 Dec 1992 18:44
Date: Sat, 26 Dec 1992 18:44
51 lines
2449 bytes
2449 bytes
People have been asking about programming ANSI escape sequences..
Well, I've got a copy of the (Free with PC Magazine) 212 Power DOS Tips! :-)
Page 61 says exactly what everyone else is saying: No Can Do From DOS.
If you are in an editor (but not all editors - Edit or Wordstar had been
tested, and I would guess any ASCII editor would do) "ESC" is entered as
"CTRL-P ESC", and displayed as "^[". Therefor "ESC[2J" (Clear Screen) is
entered as "CTRL-P[2J", and displayed as "^[[2J".
They give a solution to this (Page 62):
Often, a small utility program is convinient when creating
ANSI sequences in batch jobs. ANSAY is just such a program
and can be created as follows:
COPY con temp.hex
:100100008A0E800081E17F007416497413BB82005F
:100110008A174380FA247502B21BB406CD21E2F09F
:10012000B8004CCD210000000000000000000000DD
:00000001FF
<F6>
Debug temp.hex
r cx
25
n ANSAY.COM
w
q
The part up to <F6> (designating that the F6 key be pressed)
creates a hexidecimal file, and the debug part turns this
HEX file into ANSAY.COM
Ansay.com is a program which behaves exactly like the Echo,
but turns every occurance of the '$' character into an
escape. Batch jobs containibg Ansay commands can be written
with any editor, and can be printed.
This means that the example above (Clear Screen) is:
ansay $[2J
They also give ways of using EDLIN and DEBUG to write short scripts that
can be 'TYPE'd to feed ansi commands to the console, but I don't think
that that is what you are after.
Hope this helps one and all - And may '93 be a colourfull year (and please
don't Drink And Drive!)
--
--- Kiz (aka Ian Stuart) istuart@nyx.cs.du.edu
{ Chivalry is not dead! - Just the Horse }
Technical Details
Message-ID:
<1992Dec26.184442.510@mnemosyne.cs.du.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!mnemosyne.cs.du.edu!nyx!istuartReferences:
<1992Dec23.195236.28511@netcom.com> <1hc5qoINNjl2@sauna.cs.hut.fi>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.misc Path: arc1-ca.pugleaf.net!sparky!uunet!mnemosyne.cs.du.edu!nyx!istuart From: istuart@nyx.cs.du.edu (Ian Stuart) Subject: Re: ANSI ESC sequence, how?? Message-ID: <1992Dec26.184442.510@mnemosyne.cs.du.edu> X-Disclaimer: Nyx is a public access Unix system run by the University of Denver for the Denver community. The University has neither control over nor responsibility for the opinions of users. Sender: usenet@mnemosyne.cs.du.edu (netnews admin account) Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept. References: <1992Dec23.195236.28511@netcom.com> <1hc5qoINNjl2@sauna.cs.hut.fi> Distribution: inet Date: Sat, 26 Dec 92 18:44:42 GMT Lines: 51