Mail Archives: djgpp/1999/12/06/14:51:14
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.
- Raw text -