Solved

reset cursor position on the screen

Posted on 1998-09-07
4
526 Views
Last Modified: 2011-09-20
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
Comment
Question by:galdes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

by:rbr
ID: 1252523
Which OS and compiler you use?
0
 
LVL 11

Accepted Solution

by:
alexo earned 100 total points
ID: 1252524
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
 

Author Comment

by:galdes
ID: 1252525
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
 
LVL 11

Expert Comment

by:alexo
ID: 1252526
>> 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question