Try the following
Rem Project: PowerBar
Rem Created: 10/28/2003 9:45:55 AM
Rem ***** Main Source File *****
PowerBar(1,10,10,100,30,10,5)
PowerBar(2,10,50,100,30,12,3)
wait key
Function PowerBar(SP,x,y,w,h,TotalBars,ActiveBars)
If bitmap exist (1) then delete bitmap 1
Create Bitmap 1, w,h
ink RGB(128,255,255),0
Box 0,0,w,h
BarSize = w/TotalBars
ink RGB(255,0,128),0
For i = 1 to ActiveBars
Box (i-1)*Barsize,1,((i)*Barsize)-1,h
Next I
ink RGB(255,255,0),0
For i = ActiveBars to TotalBars
Box i*Barsize,1,((i+1)*Barsize)-1,h
Next I
Get Image SP, 0,0,w,h
delete bitmap 1
Sprite Sp,x,y,SP
EndFunction
System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX