TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: JIM TANNER
from: MIKE PARKER
date: 1995-06-19 21:46:00
subject: Re: Example code...

JT> Looking for some PB code that does a "percent bar" such as used by an
JT> installation program to show the percent completed/percent remaining...
That's simple. All you need to know is the total value (when it's done), 
current value, and length of bar. Try this (it's written in graphics mode, 
but could be easily re-done to use ascii 219 and 177 in text mode.)
SCREEN 12
FOR A=1 TO 97526
LOCATE 1,1:PRINT A;
LOCATE 1,21:PRINT (A/97526)*100;"%"
LOCATE 1,41:PRINT (A/97526)*639;"pixels"
LINE(0,17)-((A/97526)*639,25)
NEXT A
Very poor untested code, but just the same... It'll count from 1 to 97526 and 
give you the % value, and the pixels. The formula is
(current_value/maximum_value)*length_of_complete_bar
use 100 for the length_of_complete_bar to get a number back corresponding to 
the percentage.
--- Renegade v5-31 Exp
---------------
* Origin: The Lighthouse in the Wilderness.. (1:326/405)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.