Sign in to follow this  
Followers 0
benleb

ProgressBar as external process

4 posts in this topic

Hi,

I have a looonnngggg script using no GUI, that silently performs a lot of tasks.

I'd like to provide the user with a very simple GUI that only shows a progress bar and a label like "Please wait while processing...". Not a big deal up now, but things get more complicated when I try to run this progress bar in an infinite loop as an asynchronous process, simply killing it from the main script when it exits.

Actually I'm only trying to avoid updating and refreshing the progress bar everyplace along the script code, letting it run free.

Is it technically (and easily...) feasible?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It would depend on what the script is doing. Anything in a loop would be easy.

For example, if you had a loop counting from 1 to 1000000 you could do something like this.

GUICreate("Progress", 100, 20)
$progress = GUICtrlCreateProgress(0, 0, 100, 20)
GUISetState()

Local $num

While $num <= 1000000
    $num += 1
    GUICtrlSetData($progress, $num / 10000)
WEnd

anything not in a loop however you would have to use guictrlsetdata every time you wanted it updated.

Edited by Hawkwing

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

Unfortunately my script is rather a linear process and I was looking for something that would workaround the need for GUI_CtrlSetData() everywhere in the code...

Thanks anyway Hawkwing.

Share this post


Link to post
Share on other sites

There has to be some points where the progress bar knows when to update and what to update to. You don't need to use a GUI to do it though.

Help File >> Function Reference >>Message Boxes and Dialogs >>

ProgressOn()

ProgressSet()

ProgressOff()


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
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
Sign in to follow this  
Followers 0