In article <001801c2cf6b$5b175020$2f2cfd3e@blackpc>, Dilwyn Jones <[EMAIL PROTECTED]> writes
>Malcolm Cadman wrote: > >> Has anyone written a progress bar in SuperBASIC ? >> >> To inform the user of the progress made during a longish operation >like >> processing a file. >> >> A graphical presentation would also be useful. >> >> 0% ****...............100% >> >> ( Crude ASCII illustration above ). >Here are a few ideas for progress bars which I have written. They are >graphical bars in the top left corner of window channel #0. The first >listing sets out the theory for an elapsed time bar, which you can >study and adapt to your own needs. The actual theory is that you >decide on the width of the bar in pixels, then take the total amount >of time that is to represent (in seconds) and divide the width by the >number of seconds to get the number of pixels per second, which may >well be a non-integer like 1.5 pixels per second. Then for each call >to the progress indication, you multiply the elapsed time by the >number of pixels per second and use BLOCK to draw a bar of that width. >A little bit of care is needed if the bar is to be width 0 pixels as >not all versions of S*BASIC will draw a BLOCK of 0 piel width without >an error, also you may wish to draw a block of the full width in the >background colour if elapsed time is 0 and the indicator is likely to >cycle round to 0 again during operation (see example 3 below). The >REMarks should show how it works. < clip of code examples ... > Great set of ideas, Dilwyn. Thanks. This will definitely get me coding again, when I get the time. I am using DATE and 'start_time' already to give a timing of how long the process takes. The result is printed out in a table at the end to inform the user. -- Malcolm Cadman
