is there a way to get the current courser position.., so if I put that in the position numbers in the gotoxy() function, it'll stay in the same spot?
thnkx
Printable View
is there a way to get the current courser position.., so if I put that in the position numbers in the gotoxy() function, it'll stay in the same spot?
thnkx
In my compiler (Borland 5.5) I have wherex() and wherey(). Maybe you have these?
I only found them by opening conio.h and looking to see what function prototypes are in there.
It's not terribly difficult to create a Windows implementation of wherex and wherey with gotoxy from the FAQ.
-PreludeCode:#include <windows.h>
COORD coord;
void gotoxy(int x, int y)
{
coord.X = (short)x;
coord.Y = (short)y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
int wherex ( void )
{
return coord.X;
}
int wherey ( void )
{
return coord.Y;
}
thankx guys :)