Re: (C) Simulated progress bar
From: Chris \( Val \) (chrisval_at_bigpond.com.au)
Date: 11/18/04
- Previous message: Chris \( Val \): "Re: Floating Point Precision guidance."
- In reply to: Paul Fedorenko: "(C) Simulated progress bar"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Nov 2004 22:01:34 +1100
"Paul Fedorenko" <pfedorenko@look.ca> wrote in message
news:mxAld.52481$Z7.1566655@news20.bellglobal.com...
| My friend, the psychologist, who asked me to put together a little program
| for him has asked me if I could get the program to pause for a second
| between turns and to display a progress indicator to make it look like the
| program's running some calculations in the background.
|
| I'm thinking the progress bar would be fairly straight-forward... Just a
| for loop, set up to display a bunch of hashmarks or ASCII block characters
| one at a time... How would I get it to take a second or two to run through
| the loop? That sounds like an awfully long time.
This is best performed via extensions provided by your
implementation, however, you can write a simple busy
loop as already discussed, using the functionality
found in 'time.h'.
As for the ASCII characters, you could if you like imitate
a progress wheel, by displaying each character in an timely
fashion from an array:
const char Symbol[] = {'/', '-', '|', '-', '\\', '|'};
Cheers.
Chris Val
- Previous message: Chris \( Val \): "Re: Floating Point Precision guidance."
- In reply to: Paul Fedorenko: "(C) Simulated progress bar"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|