Command Prompt

Started by
4 comments, last by vbisme 22 years, 3 months ago
Does anyone know where to get infomation on implimenting a command prompt in a program. Instead of having a menu for the user to press 1, 2, or 3, they would type in a command. Like MySQL and others programs.
Advertisement
What are you trying to do exactly? From what it sounds, you want to look up the Windows console in MSDN...
BetaShare - Run Your Beta Right!
Within my program, I want to allow users to perform certain actions. Instead of displaying a menu saying "Press 1 to do this" or "Press 2 to do this" I want to be able to allow the users to type in the commands.

Other than scanning and testing strings. Are the more efficient methods?

By the way, how would you clear the screen and such?
Nothing is MORE efficient than string scanning, (I assume you mean prarsing) and for clear screen: (The cheesy way)

  int a;a=1;while (a<=20){   cout << "\n";   a++;  }  


Either, string parsing is easier in C/C++ than in any other language in my opinion. (None of those clunky functions...)
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
I would like to take control of the screen allow me to put the cursor where I want and not just have the scroll down type comannd prompt. Like in DOS the cls command clears the screen and put the cursor at the top. Any tip?
AllocConsole()SetConsoleCursorPos()WriteConsoleOutputCharacter()FreeConsole() 

...and so on. Win32-specific, and sometimes a pain (especially if you have a preference for OO, so you might want to "wrap" them).

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!

This topic is closed to new replies.

Advertisement