473,799 Members | 3,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("\nItera tion:%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 4073
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("\nItera tion:%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("\nIte ration:%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(voi d)
{
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("\nCompl eted!\n");
}

Nov 15 '05 #3

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

Similar topics

19
105844
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: System.out.print((char)27 + "[2J");
11
5820
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 course). Is there another way? Here is the simple script for now
8
11775
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 course). Is there another way? Here is the simple script for now
16
2681
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 pywin32, I haven't been able to do anything with it. I'd really just like to get the window text into a string. By "console window", I mean the sort of thing that comes up when you run "command" (although this particular one is for the game...
1
425
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. { .... system("cls"); printf("\nIteration:%d", i);
0
1302
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 dropdown list. Previously i've written a lot of these page's by not using the webcontrols, but now i've reached this magically moment that i want to try these features. :D
4
1547
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
1955
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 letters across the screen position-by-position, and whatnot. First thought was to make a 2d array representing the screen, do whatever updates i want, then cout it all - update by update, frame by
2
1610
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 ): .... print 2 .... '\tdef f( self ):\n\t\tprint 2\n' This enabled by a log file, optionally set to console.log. Contents are:
3
1850
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 is that the threading does not work and to make the application run every thirty minutes am i suppose to create a windows service. Please let me know Thanks
0
9544
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10238
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.