TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bill Birrell
from: Robin Sheppard
date: 1998-08-22 00:45:06
subject: ANSI escape codes

BB> Hello David,
 
 >->   /* ANSI sequence to clear screen: */
 >->   curse(0, 0); outc(ESC); printf("[0J");
 
 > That should be:
 > curse(0, 0); printf("\x27[2J");

 BB> I'm afraid not. That doesn't work even on a DEC VT100.

 BB> ---------------------------------------------------
 BB> your suggestion:-

 BB> #include 
 BB> int main() { return printf("\x27[2J"); }

 BB> ---------------------------------------------------

 BB> when compiled produces '[2J on the screen. Try it for yourself.

 BB> However, the original code still works, so no harm done. :-)
 
 > I know my C and I know my ANSI.

 BB> I'll bet you're sorry you said that now. :-) To prevent 
 BB> causing yourself this kind of embarrassment in future, may 
 BB> I suggest that you try out your 'corrections' before you go to press?

   After this message, I expect he's suitably chagrined.  :>

 BB> Since Tom has not commented to you, and it isn't too 
 BB> long, I will take it that it's OK to reproduce the ANSI 
 BB> Standard here:-

   [sniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiip!]

 BB> Now at least you do know where to look up the standard 
 BB> ANSI escape sequences for VDU and VDT. :-)

   Look it up?  Why would anyone want to do that, when you posted it 
   in its entirety?
   
   Thanks, though.  My list of ANSI escape sequences was mostly 
   complete, but it was missing a few of the items you had in there- 
   line insertion, deletion, and scrolling, in particular.  This will 
   likely prove useful in future endeavors, such as with the terminal 
   program i hope to write at some point in the future.  :)
   
... Christian Science programming: "Let God debug it!"
___ Blue Wave/DOS v2.30 [NR]

--- Maximus 2.01wb
* Origin: Basic'ly Computers: Mooo-ing Right Along. (1:153/9)
SEEN-BY: 396/1 622/419 632/371 633/260 267 270 371 634/397 635/506 728 810
SEEN-BY: 639/252 670/213 218
@PATH: 153/104 2 716 7715 140/1 270/101 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.