Is there a function to set the cusor in a console app to the beginning?
Is there a function to set the cusor(the blinking line) in a console app back to the beginning?
Please respond ASAP and thanks.
Im not sure exactly which tutorial it is, but if you look over at www.gametutorials.com there are some nice tutorials about console programming which cover what you want. Check out the C++ tutorials section.
Life is all about expression, so express yourself.
don''t double post everybody hates it. Yes i''m sure there is a way to put the cursor back to the beginning of the line, it is an escape key, i think \g. if thats not then go try every letter.
~EODCyismARDEM
To go back letter by letter, you can use
There must be other things you can do, though, but I''m not really that knowledgable. If you are using Windows, I think there is function, something like
I''m not sure, as you did not say, whether or not you wanted the text outputted to the console to remain visible, but you could use
:::: Lektrix ::::
[ Google || ACCU || BarrysWorld || E-Mail Me ]
\b
.There must be other things you can do, though, but I''m not really that knowledgable. If you are using Windows, I think there is function, something like
SetConsoleCursorPosition()
, that might help - have a search at MSDN.I''m not sure, as you did not say, whether or not you wanted the text outputted to the console to remain visible, but you could use
system("cls");
to clear the screen, leaving the cursor at the top (in its original position). :::: Lektrix ::::
[ Google || ACCU || BarrysWorld || E-Mail Me ]
[ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || CUJ || MSVC++ Library Fixes || BarrysWorld || [email=lektrix@barrysworld.com]E-Mail Me[/email] ]
Only in some versions of ? I believe. I don''t think it works in VC++ either. I could be wrong.
Peon
I think the equivalent
:::: Lektrix ::::
[ Google || ACCU || BarrysWorld || E-Mail Me ]
gotoxy()
function for Windows'' command prompt is, as I mentioned earlier, SetConsoleCursorPosition()
, or at least it is something that you can use. I looked on the net and found this code - seems to work fine: void SetCursor(int row, int col){ col =- 1; row =- 1; COORD cursorcoords; cursorcoords.X = col; cursorcoords.Y = row; SetConsoleCursorPosition(handle, cursorcoords);}
:::: Lektrix ::::
[ Google || ACCU || BarrysWorld || E-Mail Me ]
[ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || CUJ || MSVC++ Library Fixes || BarrysWorld || [email=lektrix@barrysworld.com]E-Mail Me[/email] ]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement