And just for fun, here's a demo using a slightly modified version of the function.
REM ********************************
REM * Title: Energy Meter Demo *
REM * Author: Phaelax *
REM * Date: Nov 22, 2009 *
REM ********************************
sync on
sync rate 60
Type Bar
targetValue as float
currentValue as float
EndType
barCount = 16
dim bars(barCount) as Bar
for i = 1 to barCount
bars(i).targetValue = rnd(100)/100.0
bars(i).currentValue = bars(i).targetValue
next i
width = 12
height = 100
timestamp = timer()
do
cls
MX = mousex()
MY = mousey()
for i = 0 to barCount-1
healthBar(MX+i*13, MY, width, height, bars(i+1).currentValue)
if bars(i+1).currentValue <= bars(i+1).targetValue
bars(i+1).currentValue = bars(i+1).currentValue + 0.025
if bars(i+1).currentValue > bars(i+1).targetValue
bars(i+1).currentValue = bars(i+1).targetValue
bars(i+1).targetValue = rnd(100)/100.0
endif
else
if bars(i+1).currentValue > bars(i+1).targetValue
bars(i+1).currentValue = bars(i+1).currentValue - 0.025
if bars(i+1).currentValue < bars(i+1).targetValue
bars(i+1).currentValue = bars(i+1).targetValue
bars(i+1).targetValue = rnd(100)/100.0
endif
endif
endif
next i
set cursor 0,0
print bars(1).targetValue
print bars(1).currentValue
sync
loop
function healthBar(x, y, width, height, P#)
rem gradient bar
seg = height / 3
box x, y-seg, x+width, y, rgb(0,255,0),rgb(255,255,0),rgb(0,255,0),rgb(255,255,0)
box x, y-seg-seg, x+width, y-seg, rgb(255,255,0),rgb(255,128,0),rgb(255,255,0),rgb(255,128,0)
box x, y-height, x+width, y-seg-seg, rgb(255,128,0),rgb(255,0,0),rgb(255,128,0),rgb(255,0,0)
rem bar's horizontal lines
C = 0x33000000
r = height / 5
for i = 1 to r
yy = y - i*5
box x, yy, x+width, yy+1, C,C,C,C
next i
rem empty bit
ink rgb(48,48,48),0
`ink 0,0
box x, y-height, x+width+1, y-height*P#
rem highlight
c1 = 0xBBFFFFFF
c2 = 0x00FFFFFF
box x, y-height*p#, x+width*0.6, y, c1,c1,c2,c2
endfunction

> SELECT * FROM users WHERE clue > 0
> 0 rows returned