I can now break out of the runscritps(). I added If not $abort=1, the script will continue to process the array but will not perform any actions.
Code:
Function runscripts()
$abort=0
$stopbutton.tag = 0
$Stopbutton.Visible = "True"
$startButton.Visible = "False"
$PBarMain.Visible = "True"
$Stopbutton.EnAbled = "True"
$PBarMain.Step = $pbar
For Each $item in $ListView.Items
$item.Remove
Next
Del $localscripts+"*.log"
If Exist($inifile)
$ScriptArray = Split(ReadProfileString($inifile,"",""),Chr(10))
For Each $script in $ScriptArray
If Val(ReadProfileString($inifile,$script,"run"))
$runchk=ReadProfileString($inifile,$script,"run")
If $runRQST=1
$runchk=1
EndIf
If NOT $abort=1
If $runchk=1
$starttime=@TIME
$message=ReadProfileString($inifile,$script,"message")
$log=ReadProfileString($inifile,$script,"log")
$item=$listview.items.add
$Item.SubItems(0).Text = ($message)
$Item.SubItems(1).Text = ($starttime)
$Item.SubItems(3).Text = ($locallog + $log)
$Item.SubItems(4).Text = ("Running")
Select
Case InStr ($script,".exe")
Shell $script
Case InStr ($script,".kix")
Call $script
EndSelect
If $Form.Visible AND $stopbutton.tag = 0
Do
$= Execute($Form.DoEvents(1))
Until
Exist ($locallog+$log)
$Item.SubItems(2).Text=(@time)
$Item.SubItems(4).Text=("Complete")
$PBarMain.PerformStep ()
Else
$abort=1
$item=$listview.items.add
$Item.SubItems(0).Text = ("Session Aborted by "+@FULLNAME)
$Item.SubItems(1).Text=(@DATE)
$Item.SubItems(2).Text=(@time)
Open (9,$netlogs + $userlog,5)
WriteLine (9,'<TD><B><font size="-1"><font color=#ff0000>User Aborted Session $message</font></TD><TD><font size="-1"><font color=#ff0000>' + @DATE+ "," + @TIME + '</TD><BR></B></TR></font>'+@CRLF)
Close (9)
$stopbutton.tag = 0
$Stopbutton.Visible = "False"
$Startbutton.Visible = "True"
$Stopbutton.Enabled = "False"
$Startbutton.Enabled = "True"
EndIf
EndIf
EndIf
EndIf
Next
If NOT $abort=1
$item=$listview.items.add
$Item.SubItems(0).Text = ("Session Completed Sucessfully")
$Stopbutton.Visible = "False"
$Startbutton.Visible = "True"
EndIf
EndFunction
This also eliminated the abort() function.