'Percentage Bar by Jason Laviska.
'LaserArts' Library Function P-02-F
'--- Public Domain --- Use at your own risk ---
 
'    This is the percentage bar indicator as found in all the
'LaserCompare programs.  I had a few requests by internet email asking
'for this little code, however, I simply responded with "It's quite easy,
'just think about it."  Well, for those who never bothered, here it is.
'Its a simple subprogram that displays the percentage bar starting where
'your cursor is located.  You may have to modify it if you will be
'transmitting integers for the Current! or Total! parameters.
 
Delay& = 15000    ' <<<  Change delay, if needed (from 0 to 2147483647).
"LaserArts Percentage Bar Demo"
ScrnMsg 2, 1, 11, "  Programmer: Jason Laviska"
ScrnMsg 3, 1, 8, "------------------------------"
ScrnMsg 12, 1, 7, "Press any key for next demo."'To prevent above lines from clearing on CLS
"The percentage bar can do both + and - numbers.""""""You can use a different maximum values.""""You can have different lengths.""""You can use different colors.""""#### of"'PRINT USING "####% "; Temp / Temp% * 100;  'UnRem this line to show %
'Current ...... Number of X that are completed.
'Total ........ Maximum number of X that can be accomplished.
'NumBlocks% ... Length of the percentage bar.
'Kolor1% ...... Color of the blocks filled.
'Kolor2% ...... Color of the half block.
'Kolor3% ...... Color of the remaining/unused blocks.
'Simply solve for percentage.
'To make sure they are swapped
                                       'back, incase used later on as
                                       'variables.
'If > 100% then make it 100%
'Swap colors if negative.
'Determine # of filled blocks
'Determine if 1/2 block needed
'Display % of filled blocks
"*");
' FOR X% = 1 TO Primary%               'UnRemark lines if percentage
'   PRINT "*";                         'bar will be crossing over to
' NEXT X%                              'the next line.  Rem line before
'this for-next loop.
'Display half block, if needed.
"*"'Swap back if needed.
"*");       'Display remaining.
'FOR X% = 1 TO NumBlocks% - Primary%   'UnRemark lines if percentage
'  PRINT "*";                          'bar will be crossing over to
'NEXT X%                               'the next line.  Rem line before
                                       'this for-next loop.