|
-
Jun 24th, 2002, 02:10 PM
#1
move caret in dos console
Hello,
How can I move the caret in the dos console, with the X,Y coord ?
-
Jun 24th, 2002, 02:20 PM
#2
Code:
void set_cursor(int x, int y){
char esc=27;
char cx,cy
cx=x;
cy=y;
printf("%c[%c;%cH",esc,cx,cy);
-
Jun 24th, 2002, 02:39 PM
#3
I am using MVC++6.0 and when I use your code I have some weird character in the dos console
-
Jun 24th, 2002, 04:34 PM
#4
I did that from memory. It is supposed to be an ansi escape sequence for cursor positioning. Which works in DOS Console mode.
Rather than rely on what I don't remember correctly translate the escape sequences from this pageto your own use:
http://enterprise.aacc.cc.md.us/~rhs/ansi.html
-
Jun 26th, 2002, 01:39 PM
#5
Why it print all character and do not move the carret ?
-
Jun 26th, 2002, 03:11 PM
#6
here is my solution :
Code:
BOOL SetConsoleCursorPosition(
HANDLE hConsoleOutput, // handle to console screen buffer
COORD dwCursorPosition // new cursor position coordinates
);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|