tags:

views:

54

answers:

3

Hi All,

I am in desperate need of help.... :). I am running a script from cmd line console. It does a sequence of operations. whats the best way to pause the script in between to check the results and resume it back using mouse????? or any key

I would appreciate for your reply back,

-Abishek

+1  A: 

try cin.get()

Lie Ryan
A: 

There isn't any easy way to do that. You'd need to create a wrapper to run the program (for example, a debugger is a wrapper to a program), and this wrapper would have to have mouse functions programmed into it.

Without use of the mouse, use cin.get();. It will take an input from the keyboard before continuing.

trusktr
my scripts are in C++ and I have source files and and executing the file form visual studio....
Abishek
@Abishek: Set a break point then.
GMan
Perhaps take a look at the source code for DOS's text editor and see how they implemented mouse interaction. A breakpoint would suffice for me, but that's not "using the mouse" ;)
trusktr
A: 

If I understand your question correctly, and if your program is writing to the standard output (the console window) and you are running on Windows:

You can turn on 'quick edit' in the console window by editing the cmd.exe window properties.

Open a command prompt (start | run | cmd.exe) Click the upper left corner of the window and choose 'Defaults'. Click the Options tab and then in Edit Options section make sure the QuickEdit Mode box is checked. Click OK and you should be set.

If you click with the mouse inside the console window when quick edit is enabled, it will block the program from continuing while it is waiting to be able to write the next message to the output. If you then hit 'esc', the program will continue.

It's a useful shortcut for pausing a running console program that I use all of the time.

mtreit
Perfect..... Thanks
Abishek