Solved

reset cursor position on the screen

Posted on 1998-09-07
4
508 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
  • 2
4 Comments
 
LVL 10

Expert Comment

by:rbr
Comment Utility
Which OS and compiler you use?
0
 
LVL 11

Accepted Solution

by:
alexo earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
>> 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
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 opening and reading files in the C programming language.

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now