Sign in to follow this  
Followers 0
87450kalle

Calling a function and want to continue

6 posts in this topic

Hi,

I need some help with a script. I am calling a function inside a loop and I want the loop to continue

at once without waiting for the function result.

Regards Johan

Share this post


Link to post
Share on other sites



Any script is a set of step by step instructions. Functions are basically just a way to skip to a different part of the script and do something, then go back to where you were. They are most usefull for repetitive things.

However, one thing you could do to get the results you want is to make another script that will do the things you are wanting the function to do, then just start that script where you would normally do the function.


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yeah, what SpookMeister said.

@87450kalle,

Without seeing your code or a small sample that shows what you are doing in the loop and function in question, it is hard to suggest a possible workaround. Anyway, you might want to look into the Adlib function.

Edit - I thought that I had seen "Adlib" posted as a "dual loop" solution... but as we all know, just because it has been posted as a solution - doesn't make it right. I should have tested my proposed solution before posting it. Thanks cameronsdad for the gentle correction.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Yeah, what SpookMeister said.

@87450kalle,

Without seeing your code or a small sample that shows what you are doing in the loop and function in question, it is hard to suggest a possible workaround. Anyway, you might want to look into the Adlib function.

Have the Adlib function do what your current function does - but only is a flag is set.

Within your current loop, set the flag at the point that you currently call your function.

later...

but even with a toggle that makes the adlib run only when necessary, the main loop will still be paused during the execution of the adlib function, which it sounds like is what he's tryign to avoid. @87450kalle, the first suggestion is the way to go i think, move your function to another compiled script, then call it with Run()

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Ok, I wrote a stand alone program that took care of it.

My problem was that I want to have a GUI that is always on top so that I can quit all Autoit programs that is running at ones.

Thanks for a fast reply. //Johan

Share this post


Link to post
Share on other sites

Ok, I wrote a stand alone program that took care of it.

My problem was that I want to have a GUI that is always on top so that I can quit all Autoit programs that is running at ones.

Thanks for a fast reply. //Johan

but if you quit all autoit programs, wouldn't that include the gui and effectively stop the loop at that point anyway?

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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