Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 537
  • Last Modified:

reset cursor position on the screen

how can i return the pointer to the screen to 0. ie i need to position the curser to a specified position (top left prehaps) on the screen without CLS.. how can i do this.

Thanks,
Andrew,
0
galdes
Asked:
galdes
  • 2
1 Solution
 
rbrCommented:
Which OS and compiler you use?
0
 
alexoCommented:
Let's evaluate the options.

DOS (and DOS window under Win9x):
1. The gotoxy() function in <conio.h> positions the cursor.
2. Low level: INT 10h (AH=2, DL=x, DH=y, BH=0) positions the cursor (can be called via the int86() function or similar)

Win32 console applications (Win9x and NT):
3. SetConsoleCursorPosition()

Unix etc.
4. Use the termcap routines.
0
 
galdesAuthor Commented:
i am using winodws95 and creating a dos application. i simply need a method of setting the x and y coordenate for the curser position. this is not for the mouse.
an example : the game SNAKE moves charactors around the screen in text mode.
thanks,
0
 
alexoCommented:
>> i am using winodws95 and creating a dos application
What compiler?

* Borland supports gotoxy(x,y)
* MSVC 1.5x has something similar, look in conio.h for the exact name (or use an interrupt).
* MSVC 2.x and above cannot create DOS applications.  If that's your compiler, you must be creating a Win32 console application (which LOOKS LIKE a DOS application but isn't).  In that case, you'll use SetConsoleCursorPosition()
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now