Date: Mon, 6 Dec 1999 17:47:11 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Jude Dashiell cc: djgpp AT delorie DOT com Subject: Re: using ansi.sys syntax question In-Reply-To: <2RM24.45715$oa2.363278@iad-read.news.verio.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 6 Dec 1999, Jude Dashiell wrote: > row=2; > col=30; > printf('\33''\133'row,col'\150'"natal change locator"); > in as one of the lines in this program. Note: this will only work if you have ANSI.SYS installed on your machine. Otherwise, the escape sequences will be written to the screen verbatim. > I'll probably have to substitute: > *row and *col to get the contents of row and col to write out, and > probably > the octal for the comma character. Is that likely to be all of the syntax > that's messed up in this line? No, you will need to use printf format specifiers, like this (untested!): printf ("\033[%2.2d;%2.2dH", row, col); Again, this will only work if ANSI.SYS is installed. > I'm curious if djgpp offers any other way to do this at some higher level > of abstraction too. > Other packages like ansisys-c.zip on the simtel archives have existed > since 1995 so this has me wondering about djgpp and maybe something I've missed > reading those info files. Those packages only make sense if you have a large body of existing code that already uses ANSI escape sequences, and you want to make it work on a DOS terminal without changing the original code too much. But in your case, I understand that you write the bulk of the code yourself. So you could simply use gotoxy and printf (plus fflush!) to achieve the same effect without any complications.