So here's what the code below does... it takes the total size of the bar X and divides it by the number of files Y. In a 'for-next' loop, the file's size is divided by ten. This equals the wait time before the next file is checked. Using a blue gui strip of code, I create a panel and place in the center of the screen. Underneath it, another panel (the custom bar) is placed.
How the bar moves (the amount) is retrieved from "Perform Checklist for Files." This is the number I divide the bar length by. This is then added each time in the 'for-next' loop.
The problem is no matter what I do, the bar never fills full. Even adding "If (For-next label) = Checklist Quantity then (current bar length)" I know that the number you get from dividing the total bar size by the amount of files is not always exactly the amount and I have tried rounding it up to the total size but still it does not equal the right size. Here's the code and the media...
Rem ***** Main Source File *****
Set display mode 1280,1024,32
startblue "***", "******"
Backdrop on
Color Backdrop RGB(255,0,0)
MM=CreatePanel (Desktop Width()/2-350, Desktop Height()/2 - 350, 750, 750, 0)
PPanel=CreatePanel (GadgetX(mm)+85, GadgetY(mm)+235, GadgetX(mm+85), GadgetY(mm+255),0)
Setgadgetshape MM,"Startup\SUMask.bmp"
`Setpanelimage MM, "Startup\SUI.bmp"
SetgadgetColor PPanel, RGB(0,128,255),RGB(0,0,0)
Sync on : Sync Rate 60
Perform checklist for files
Ftotal = Checklist Quantity()
Drate = 580.0 / (ftotal*1.0)
For Dats = 1.0 to (Checklist Quantity()*1.0)
sync
FileName$=Checklist String$(Dats)
Amount = File Size (Filename$)
sync
Setgadget PPanel, GadgetX(mm)+87, GadgetY(mm)+239, Dats*Drate, GadgetHeight(mm)-736
sync
wait Amount/10
next dats
Dats=0
do
sync
`Additional Code
sync
loop
Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
