Jump to content

Exiting 2nd level loop exits the program


Recommended Posts

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

Spoiler

 

#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

 

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...