Luig Posted November 19, 2009 Posted November 19, 2009 I need a progress bar for something like this. Global $varA = 1 While $varA <= GUICtrlRead($RunNumber) ;Run Loop $varA = $varA + 1 ;Run Loop Accumulator If BitAND(GUICtrlRead($EnableRelog), $GUI_UNCHECKED) = $GUI_UNCHECKED And BitAND(GUICtrlRead($EnableHMode), $GUI_CHECKED) = $GUI_CHECKED Then Call ("AtLobby") EndIf If BitAND(GUICtrlRead($EnableRelog), $GUI_UNCHECKED) = $GUI_UNCHECKED And BitAND(GUICtrlRead($EnableSCMode), $GUI_CHECKED) = $GUI_CHECKED Then Call ("AtLobbySCM") EndIf If BitAND(GUICtrlRead($EnableSCMode), $GUI_CHECKED) = $GUI_CHECKED Then Call ("DecisionSCM") Else Call ("Decision") EndIf WEnd Call ("Stop") EndIf That's the piece of my code where I set a runs vs infinate mode. I need to make a progress bar on the Runs part of it. When not in infinate mode you have to specify a number of runs, How can I make a progress bar that shows the progress of $VarA Reaching $RunNumber? In other words I want to show the progress of the runs. Since $RunNumber is an input box it isn't a static variable so I have been trying to break my head open for a while trying to figure this out.
ResNullius Posted November 19, 2009 Posted November 19, 2009 (edited) Hi luig,First of all, welcome to the forums This is for a pop-up progress bar, but you could adapt for a GUI based progress bar:Global $varA = 1 ProgressOn("Runs", "") ;<<<<< Start the progress bar $iNumberOfRuns = GUICtrlRead($RunNumber) While $varA <= $iNumberOfRuns ;Run Loop ProgressSet(($varA / $iNumberOfRuns) * 100, ($varA / $iNumberOfRuns) * 100 & "% complete", "") ; <<<<< update $varA = $varA + 1 ;Run Loop Accumulator If BitAND(GUICtrlRead($EnableRelog), $GUI_UNCHECKED) = $GUI_UNCHECKED And BitAND(GUICtrlRead($EnableHMode), $GUI_CHECKED) = $GUI_CHECKED Then Call("AtLobby") EndIf If BitAND(GUICtrlRead($EnableRelog), $GUI_UNCHECKED) = $GUI_UNCHECKED And BitAND(GUICtrlRead($EnableSCMode), $GUI_CHECKED) = $GUI_CHECKED Then Call("AtLobbySCM") EndIf If BitAND(GUICtrlRead($EnableSCMode), $GUI_CHECKED) = $GUI_CHECKED Then Call("DecisionSCM") Else Call("Decision") EndIf WEnd ProgressOff() ; <<< Close the progress Bar Call("Stop") EndIfBy the way, you don't need to use "Call" for calling your functions, you can just call them:instead of Call("AtLobby"), do AtLobby()Edit: Fixed code to use a variable ($iNumberOfRuns) that represented the value read from $RunNumber Control Edited November 19, 2009 by ResNullius
Luig Posted November 19, 2009 Author Posted November 19, 2009 Thank you, Also how do I compile my script and make it keep its bg?
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