Dxnny Posted April 28, 2021 Share Posted April 28, 2021 Is it possible to run 2 While functions at once, so they are both continuously looping at the same time Link to comment Share on other sites More sharing options...
JockoDundee Posted April 28, 2021 Share Posted April 28, 2021 (edited) Assuming you don’t mean like this: While True While Random(0,1,1) WEnd WEnd then you need two programs. Edited April 29, 2021 by JockoDundee Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Musashi Posted April 29, 2021 Share Posted April 29, 2021 4 hours ago, JockoDundee said: Assuming you don’t mean like this: While True While Random(0,1 1) WEnd WEnd then you need two programs. (Just a typo) - you surely mean : While Random(0, 1, 1) @Dxnny : It is already very late here in Germany, so I may have misinterpreted your question 😴. In principle, While...Loops can be nested : Global $vLoop1 = 1, $vLoop2 = 1, $i = 0 While $vLoop2 <= 3 ConsoleWrite(" --------------------------------------------- " & @CRLF) While $vLoop1 <= 5 $i += 1 ConsoleWrite("value i = " & StringFormat("%3i", $i) & " outer Loop = " & $vLoop2 & " inner Loop = " & $vLoop1 & @CRLF) $vLoop1 += 1 WEnd $vLoop2 += 1 $vLoop1 = 1 WEnd Also take a look at nested-loop JockoDundee 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
JockoDundee Posted April 29, 2021 Share Posted April 29, 2021 28 minutes ago, Musashi said: you surely mean : While Random(0, 1, 1) Thx, I'm always making Random mistakes like that. FrancescoDiMuro and Musashi 2 Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
caramen Posted April 29, 2021 Share Posted April 29, 2021 (edited) I pretty liked the attempt of this guy to make emulated thread in AutoIt. That allows you to run 2 while at same time. But it will be the same as doing what @JockoDundee said you. This UDF will run the two loop in different instances of AutoIt. But from one single script. The way this UDF work is not really approved by the good practice of AutoIt. Maybe it worth the try of it for you ? https://github.com/jesobreira/authread Edited April 29, 2021 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki 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