USSSR Posted June 8, 2021 Share Posted June 8, 2021 Hello I have written a pretty long (but basic) script with many hundreds of lines. I'm not so advanced with AutoIt. Basically I have a function which is a big loop and it starts with While 1 and ends up with WEnd. It has been working just fine but now I would need to add there a couple of If conditions which should make the function start from beginning. I have been trying to find and learn what is the solution but I just cant understand how to do it? I wouldn't want to post the whole script here as it is pretty long and there is also things which I would not like to show in public. For example: Func Man1() While 1 ;Do commands If ... Then ;Go to beginning of the function Else ;Do commands EndIf ;Do commands If ... Then ;Do commands Else ;Go to beginning of the function EndIf WEnd EndFunc Link to comment Share on other sites More sharing options...
RTFC Posted June 8, 2021 Share Posted June 8, 2021 ContinueLoop USSSR 1 My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 9, 2021 Share Posted June 9, 2021 I dont see a point where you ever exit that function, so I dont see a reason to make it a function at all. Your best friends in this situation are ContinueLoop, ExitLoop, and you can call a function from inside a function so some of your commands or if statements can be part of another function to help break down the logic. USSSR 1 Link to comment Share on other sites More sharing options...
JockoDundee Posted June 10, 2021 Share Posted June 10, 2021 11 hours ago, ViciousXUSMC said: I dont see a point where you ever exit that function, a command could be Return ;Do commands Btw, another way to make the function “start from the beginning” (Not Recommended):. Man1() Code hard, but don’t hard code... 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