0

I'm new to stackoverflow and would like to thank any and all people who come across this post and gives any assistance. Sorry if this question/request seems noob-ish, I am a beginner-intermediate programmer in C++(closer to beginner I would say) but I know the basic fundamentals needed for a text-based game; however this one thing is stumping me for some reason.

Anyway, I am working on my own Text-Based Game and was looking to add a feature I saw in a video(Linked below) that when a user inputs an invalid char, or choice, would display a line of red text saying, "Previous selection was INVALID, try another from the list:" at the top of the console above the current screen/menu/submenu they were on and would stay there until the user entered a valid option. I know how to change the individual line color to red without changing the other text on the screen and how to make the error system, but how do I get it to appear at the top of my menu and stay there until the user has entered a valid option. Once I figure this out I can work on customizing it further.

Video: https://www.youtube.com/watch?v=5gBU5rptR8I @54 Seconds in the vid

Much appreciated,

the newbie,

xChubz

TDubs95
  • 3
  • 3

2 Answers2

-1

Clear console text (it's OS-specific, read here: How can I clear console), and simply rewrite what you had written before with your error message on top!

Community
  • 1
  • 1
MyUsername112358
  • 1,320
  • 14
  • 39
  • Thanks, that is pretty useful. I'll try something with that in my code here in a bit, if my problem persists I'll come back here haha. – TDubs95 Dec 06 '14 at 22:13
-1

Not sure how to use a specific color but to clear the screen use:

system("CLS");
j_v_wow_d
  • 511
  • 2
  • 11