AlchemistZim Posted December 13, 2022 Posted December 13, 2022 I'm trying to mass convert some SRT files by parsing the text in them The1st loop goes through all the files in the an array The 2nd loop loads the file into another array, parses the text via StringInStr, but when I try to return the the 1st loop the script just exits I've tried Both ContinueLoop and ExitLoop, and neither works Reveal hidden contents #Region AutoIt Options Opt("ExpandEnvStrings", 1) ;0=don't expand, 1=do expand Opt("ExpandVarStrings", 1) ;0=don't expand, 1=do expand Opt("TrayIconHide", 1) ;0=show, 1=hide tray icon Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocas #include <Array.au3> #include <File.au3> #include <String.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #EndRegion Global $sFile, $aText $sDir1 = "Z:\SomeFolder" $sEXT = "srt" $aFile = _FileListToArrayRec($sDir1, "*.$sEXT$", 1, 1, 1, 2) For $i = 1 To 10 ;$aFile[0] $sFile = $aFile[$i] _FileReadToArray($sFile, $aText, 1) For $i = 1 To $aText[0] If StringInStr($aText[$i], "[") <> 0 Or StringInStr($aText[$i], "(") <> 0 Then MsgBox(0, '', $sFile & "FOUND IT") HERE IS WHERE I'M HAVING MY PROBLEM...I want to exit this current loop and return to the first one...NOT SURE WHAT TO DO EndIf Next Next
TimRude Posted December 13, 2022 Posted December 13, 2022 ExitLoop is the correct command. Your problem is that you're using $i as your loop variable in both loops. Change one of them to something else.
AlchemistZim Posted December 13, 2022 Author Posted December 13, 2022 Thank you...that did it I need to get better with my loop variables
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