Jump to content
Sign in to follow this  
Hest

[Solved] Update label while rest of script runs

Recommended Posts

Hest

Ok, I'm not sure how to explain this, but here goes..

I have a program with a button that acts like start and stop for a stopwatch. Press start sets Running=1 pressing stop sets it to 0. easy enough.

When I press stop, the time_label updates with the time it took and it all works fine.

Now I want to update the label while the time is ticking, but if I make a "while running = 1", the program keeps running through the loop and doesn't notice any button clicks anymore.

Is it possible to do some kind of loop that runs in the background, while the rest of the script runs?

Edited by Hest

Software:Model Train Calculator (Screen)Autoit3 beginner!

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

have a look at AdlibEnable or just make an If condition in your main loop.

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
picea892

Adlibenable is probably what you need. Another solution could be to add this to the while loop you presently have.

global $refreshing

$refreshing=1+$refreshing

if $refreshing=30 then

refresh()

$refreshing=1

EndIf

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.