Solved

reset cursor position on the screen

Posted on 1998-09-07
4
515 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ check and remove last word from a string 5 217
Compile VxWorks Toronado project under Visual Studio 11 223
Super Scope, DHCP 5 91
Windows Server 2012  Backup - HyperV host 18 65
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…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

821 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