Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!SUN.COM!wmb From: wmb@SUN.COM (Mitch Bradley) Newsgroups: comp.lang.forth Subject: Re: Setting cursor routines for the Forth editor Message-ID: <8905232003.AA01385@jade.berkeley.edu> Date: 23 May 89 16:12:06 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Forth Interest Group International List Organization: The Internet Lines: 46 I believe that most PCs have a file called ANSI.SYS that can be configured into your system to make it act like an ANSI standard terminal. This feature apparently first appeared in DOS 2.0, and is enabled by including ANSI.SYS in the CONFIG.SYS file. (Disclaimer: I don't actually own a PC, so I'm getting this from a book). Assuming that this is the case, here is a partial list of escape codes for ANSI-compatible terminals. These I do know for sure: left-character ESC [ D right-character ESC [ C up-line ESC [ A down-line ESC [ B move-cursor (at) ESC [ yyy ; xxx H insert-character ESC [ @ delete-character ESC [ P erase-to-end-of-line ESC [ K erase-to-end-of-screen ESC [ J insert-line ESC [ L delete-line ESC [ M Notes: ESC means output the escape character, decimal 27 [ means output the "[" character yyy is an ASCII decimal number representing the line number (1..#lines) xxx is an ASCII decimal number representing the column number (1..80) Some of these commands can take a numeric argument after the [ , specifying a repeat count, but that isn't needed in many applications. Consequently, in F83, ANSI-AT would look something like this: decimal : ansi-at ( x y -- ) 27 emit ascii [ emit 1+ (.) type ascii ; emit 1+ (.) type ascii H emit ; Note the use of "(.) type" instead of just "." . This is done to prevent a trailing space from being output after the number. The rest is left to the reader as an exercise. Mitch Bradley