?
Solved

reset cursor position on the screen

Posted on 1998-09-07
4
Medium Priority
?
531 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 300 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

718 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