Jump to content

Math problem using progressbar


Rex
 Share

Recommended Posts

Hi

I'm terrible to math :(

So I have a problem, i'm using a progressbar in my script to keep track.

But some how my math makes it go way over the 100% :

My code is.

Func _progress($msg)
Sleep(500)
$Pct = $Pct / $Count * 100
ProgressSet($Pct, $msg & ' | ' & Round($pct)) ;Set progress bar
EndFunc

Current I call the function 14 times, and therefor i have set the $count to 14, the $Pct is set to 1 at start up.

What am I doing wrong, took the math formula from a download progressbar where the $pct was current dl size and $count was the filesize in total

Hope that some on can help me :)

Cheers

/Rex

LOL found the solution my self :D

$i = 1

$i = $i + 1 at the end of the function did the trix.

All i had to do was post in here, and the solution came to me :)

Cheers

/Rex

Edited by Rex
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...