Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PAUSE THE OUTPUT SCREEN IN VC++

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0

Does any one know how to pause the output one screen at the time in Microsoft Visual C++.

Thank you
 
look bro
just include stdlib.h
then type:

system("CLS");

thats IT!!!!!!!
YES IT IS THAT SIMPLE!!!
there are other ways which i know if u are interested....but they are cody!
PEACE
Tam
 
well,maybe this will do:

#include<stdlib.h>
.....
.......
system(&quot;pause&quot;);
system(&quot;cls&quot;);
 
Hi,
Both of your solutions imply the developer has control of the output going on.

If the answer was that simple I believe counting the number of lines of output and every 20+ lines

&quot;Please hit return to continue\n&quot;

would suffice. However since

cout << EOLN;

can be coded anywhere in the program it is a little hard for the programmer to count lines.

Are there member functions inside the Streams IO class to set a PAUSE count to tell it to pause every X lines regardless of where the output is coming from so the developer doesn't have to count lines?

---
 
hi again
i agree with what tdatgod said,
but he can still use this function to pause...
#include<conio.h>
cout <<&quot;Press any key to continue&quot;;
while(!kbhit)
{
}
peace
Tam
 
if you want your program to stop after a certain amount of lines do the following ->

You'll have to have a variable counting the lines..

char variable;

if (counter%20 == 0 && counter !=0)
{
cout << endl << Press enter to continue&quot;;
cin >> variable;
}

just change 20 to however many lines you want it to stop after.
 
Hi,
This all seems fine and good but then the question is

where do you Increment counter?

COUT can be coded in any memeber function in any class in any library.

I know your code above works fine in side the library the developer writes themselves but what if they want want to Pause all output not just the ones their class is issuing.


The only logical place to increment counter is inside the IOSTREAM class where all calls to COUT eventually make it.

However most developers don't have access to the IOSTREAMS code therefore the only way to have something like this implemented is to Inherit the IOSTREAM class and override all the stream functiosn so you can increment counter at each function.

Is there already a member function in the IOSTREAMS class which can

Tell the caller how many lines (EOLN) have been output.

or

Set a screen size value so that it will automcatically
pause when it reaches the end of the screen?

or help in some other way to solve this problem.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top