Discussion Locked

How do I put an ESC character in Edit?

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I am trying to use the ANSI.sys Escape commands to change the screen colors for a massive AUTOEXEC.BAT file that I am writing and I want to use the "ECHO [....." method of calling the commands. I don't want to use the "prompt $e..." method. The only problem I have is that I can't figure out how to place an ESC character (ASCII 27) into DOS's EDIT program. I scoured search.microsoft.com for any help-- none.

I know that you can use WinWord (from Win3.1) and other windows programs to enter this, but I also need to see the extended ASCII lines that I use as boxes around my text. Help me Obi Wan. You're my only hope.

TIA,
Joe

7 replies

by techrep

What *I* would do is write a simple BASIC program to modify the file. the ESC character is CHR$(27). I will help you write the BASIC program *if you need help*, but I suspect from the description that you have given of the task, you may already know how to do this. Anyhow, use EDIT to create the file, but everytime the ESC character is "needed", hold down the ALT key and ON THE KEYPAD (not the row of numbers), type 187. this will insert a character that is virtually un-mistakable for any other character. Save your file. Now go write a BASIC program that reads the file in line by line and replaces the CHR$(187) with CHR$(27).

by jeng

As odd as it may sounds, I just tried this in EDIT on WinNT. (Don't ask me why I thought of it - there's some history to it somewhere.) :)

When you need an escape character at your the current cursor position, press control-P. Then press and holdthe ALT key, and type "27" (without the quotes) on the numeric keypad and release the ALT key. You should see a left pointing arrow character. That's your escape character.

It might work in the earlier versions of EDIT for DOS but I'm not sure. Personally, I'd recommend another editor for what you're doing that can let you insert "binary characters".

by ankin

answer nr. 2 is correct and it also works in older versions of the DOS edit

by joe

Thanks to everyone who offered help to me on this issue. My short-term solution was to get a copy of the PE2 dos editor and generate the ASCII 27, save it to a file and open it in EDIT. Answer 2 was the most helpful because it answered the exact question that I had and I tried it and it works perfectly.

Thanks people!
Joe

This discussion is closed to new replies.