There is a whole "console API" in Win32. It is powerful, but not as straightforward as MS-DOS text manipulation - this is because an application may in fact have multiple consoles. What you would normally do is create wrapper functions to hide the details of window handles and the like.
Clearing the screen is less straightforward. There is a quick-and-dirty method with significant run-time inefficiency, and a longer but more efficient method. Both are described at http://support.microsoft.com/kb/99261
Since the longer but more efficient method is simply a case of copying and pasting the code into your application, I suggest that it is in fact no more difficult than the quick-and-dirty method, and recommend that you use that. Best; create yourself a library of such code for re-use.
A lot of what you seem may be provided by Adrian Sandor's conio library. It is a clone of Borland's conio. If it does not do what you want, the source it is at least a good example of how to use the Win32 console API effectively. http://www14.brinkster.com/aditsu/console/
On the same page you can get WInBGIm as Win32 clone of Borland's BGI library, however it is a very old version (and the doc link is broken). If you need that, use this: http://codecutter.org/tools/winbgim/
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Typo: I should have written: "A lot of what you seek [...]"
I took a quick look at Adrian's conio, and it does indeed have clrscr() and gotoxy() (and everything else you might expect if you are familiar with borland conio).
I suggest that you download the source rather than the library both because the binary is old and built with an older version of GCC, and because having the source will allow you to port it to other compilers and ensure that your code can be supported in the future (so long as the Win32 API exists). It also serves as a good example of how to use the Win32 Consol API. Porting it to the .NET console API, or other APIs would be relatively simple.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hello:
a newbie question:
In console applications, is there any equivalent for old borland dos-mode gotoxy(x,y) and clrscr() functions?
thanks
Maurice
There is a whole "console API" in Win32. It is powerful, but not as straightforward as MS-DOS text manipulation - this is because an application may in fact have multiple consoles. What you would normally do is create wrapper functions to hide the details of window handles and the like.
The Win32 Console API is described at http://msdn.microsoft.com/en-us/library/ms682073%28VS.85%29.aspx
Specifically, setting the cursor position is described at http://msdn.microsoft.com/en-us/library/ms686025%28VS.85%29.aspx
In most cases, the window handle you will need for these functions can be obtained by GetStdHandle() http://msdn.microsoft.com/en-us/library/ms683231%28VS.85%29.aspx
Clearing the screen is less straightforward. There is a quick-and-dirty method with significant run-time inefficiency, and a longer but more efficient method. Both are described at http://support.microsoft.com/kb/99261
Since the longer but more efficient method is simply a case of copying and pasting the code into your application, I suggest that it is in fact no more difficult than the quick-and-dirty method, and recommend that you use that. Best; create yourself a library of such code for re-use.
A lot of what you seem may be provided by Adrian Sandor's conio library. It is a clone of Borland's conio. If it does not do what you want, the source it is at least a good example of how to use the Win32 console API effectively. http://www14.brinkster.com/aditsu/console/
On the same page you can get WInBGIm as Win32 clone of Borland's BGI library, however it is a very old version (and the doc link is broken). If you need that, use this: http://codecutter.org/tools/winbgim/
Clifford
Typo: I should have written: "A lot of what you seek [...]"
I took a quick look at Adrian's conio, and it does indeed have clrscr() and gotoxy() (and everything else you might expect if you are familiar with borland conio).
I suggest that you download the source rather than the library both because the binary is old and built with an older version of GCC, and because having the source will allow you to port it to other compilers and ensure that your code can be supported in the future (so long as the Win32 API exists). It also serves as a good example of how to use the Win32 Consol API. Porting it to the .NET console API, or other APIs would be relatively simple.
Clifford