473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Console Screen update - Iteration Count


I am writing a simple hardware test program in C that would run from
Windows command line.

Inside one of the loops, I have this code fragment that would display
the Iteration count.

{
....
system("cls");
printf("\nIteration:%d", i);
....
}

Since I have to clear the screen everytime I update the Iteration
count, there is lot of "FLICKERING".

Is there a better way to update the Iteration count without having to
clear the screen?

Regards,
Karthigan.

Nov 15 '05 #1
2 4043
ka*******@yahoo.com wrote:
I am writing a simple hardware test program in C that would run from
Windows command line.

Inside one of the loops, I have this code fragment that would display
the Iteration count.

{
...
system("cls");
printf("\nIteration:%d", i);
...
}

Since I have to clear the screen everytime I update the Iteration
count, there is lot of "FLICKERING".

Is there a better way to update the Iteration count without having to
clear the screen?

Regards,
Karthigan.

try something like... should help in reducing the flickering...
{
....
printf("%08d\b\b\b\b\b\b\b\b",i);
fflush(stdout);
.....
}
Nov 15 '05 #2
karthi...@yahoo.com wrote:
Inside one of the loops, I have this code fragment that would display
the Iteration count.
{
...
system("cls");
printf("\nIteration:%d", i);
...

}
Since I have to clear the screen everytime I update the Iteration
count, there is lot of "FLICKERING".
Is there a better way to update the Iteration count without having to
clear the screen?


this subroutine may be useful for you to scratch some ideas.
but if it is far from your problem, just forget it.
void process_bar(void)
{
unsigned int i;
unsigned long j = 0L;

printf("Copying......");
for(i = 1; i < 101; i++)
{
printf("%%%3d", i);
printf("\b\b\b\b");
j = 0L;
while (j < 60000000)
{
j++; /*delay)*/
}
fflush(stdout);
}
printf("\nCompleted!\n");
}

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
11
by: Totte Karlsson | last post by:
Hi, How can I print to the console without having it scrolling to a new line for each print statement? I want to print a count down in the console, but for each count it scrolls the screen (of...
8
by: Totte Karlsson | last post by:
Hi, How can I print to the console without having it scrolling to a new line for each print statement? I want to print a count down in the console, but for each count it scrolls the screen (of...
16
by: Chris Maloof | last post by:
Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via...
1
by: karthigan | last post by:
I am writing a simple hardware test program in C that would run from Windows command line. Inside one of the loops, I have this code fragment that would display the Iteration count. { .......
0
by: Pietje puk | last post by:
Hello, Since im quite new to ASP.NET i wanted to ask you folks what the best way is to create a WebForm for modifying 1 field from a record. The manipulation of this field can be done by using...
4
by: djc | last post by:
is this possible: lets say my output has 2 columns with headings like 'host' and 'status'. host status ------------ host1 down host2 up host3 up host4 down
2
by: sherifffruitfly | last post by:
Hi, I'm just learning cpp, and something I've had on my mind for awhile is to make a little "virtual console screen" class structure. In it I want to be able to do "text animation" - moving...
2
by: castironpi | last post by:
Presents a console permitting inspection. Input as well as output saved in Python-readable form. Python 2.5.1 memoryconsole4.py logging to My Documents\console.log .... def f( self ): .... ...
3
by: cmrhema | last post by:
Hello I have written the following in console application. My problem is I want the application running in the back. and it should check every thirty minutes and update thedatabase the problem...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.