antmar904 Posted July 28, 2013 Share Posted July 28, 2013 Ive been trying for a couple of day to update a progress bar that i have in my gui but i just cant seem to get it working. i am sure that this function needs more improvment also. some lines where copied from other scripts (thank you) here is what i have: Func _Update() Local $FileSize Local $url = "http://downloads.sophos.com/tools/sav32sfx.exe" ;Set URL Local $folder = @ScriptDir & "\files\CLI\sav32sfx.exe" ;Set folder Local $hInet = InetGet($url, $folder, 1, 1) ;Forces a reload from the remote site and return immediately and download in the background While Not InetGetInfo($hInet, 2) ;Loop until download is finished Sleep(500) ;Sleep for half a second to avoid flicker in the progress bar GUICtrlSetData($lblUpdating, "Downloading CLI") Local $BytesReceived = InetGetInfo($hInet, 0) ;Get bytes received Local $Pct = Int($BytesReceived / $FileSize * 100) ;Calculate percentage GUICtrlSetData($Progress1, $Pct & "%") ;Trys to update progress bar WEnd GUICtrlSetData($lblUpdating, "") EndFunc thanks in advance. Link to comment Share on other sites More sharing options...
Solution FireFox Posted July 28, 2013 Solution Share Posted July 28, 2013 Hi, I see that the $FileSize var is never assigned. Br, FireFox. Link to comment Share on other sites More sharing options...
Edano Posted July 28, 2013 Share Posted July 28, 2013 (edited) GUICtrlSetData($Progress1, $Pct) maybe ? surely and division by zero => Firefox Edited July 28, 2013 by Edano [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font] Link to comment Share on other sites More sharing options...
antmar904 Posted July 28, 2013 Author Share Posted July 28, 2013 oooops Local $FileSize = InetGetSize($url) Thanks for the quick response ! Link to comment Share on other sites More sharing options...
aleph01 Posted July 31, 2013 Share Posted July 31, 2013 Division by zero? Edano, you must be almost as old as I am! The younger, digital crowd don't understand we analogs, and they have never heard of division by zero errors. All that's ok, they have black and white (digital, binary), we have all the colors of the rainbow (analog)! Meds. They're not just for breakfast anymore. Link to comment Share on other sites More sharing options...
Edano Posted August 1, 2013 Share Posted August 1, 2013 is division by zero allowed meanwhile ? you never know. times are a'changing. [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font] Link to comment Share on other sites More sharing options...
aleph01 Posted August 1, 2013 Share Posted August 1, 2013 Methematically, division by zero is undefined. But, then again, infinity minus infinity is infinity, go figure. Meds. They're not just for breakfast anymore. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now