In updating one of my scripts, I have added a couple more dir() functions. I have been doing my developement and testing on a win2k box, and everything works great. Before I considered it final, I tested it on an NT4 box, and I got an error. I am using Kix v4.0(RC3), but also verified the same issue with Kix v3.63. I narrowed the error down to dir(). I have to specify an index on the dir() that errors, where on the win2k box I don't. It seems that kix thinks I have a prior dir() still going, but I don't, as the win2k box runs the script fine. Is anyone familiar with this problem? Thanks!

In case you need an example, here is the code that's giving me problems. I have commented out chunks so the script will run without other dependent files.
You will need to create 2 files for the dir()'s to work:
SPSM_Web.mod and SPS_blah.ini
(The last file can be any SPS_*.ini, and the contents of either does not matter)
Also, you can alternate the comment from the 44th and 45th lines. The script as is should error on NT4, but not on win2k. If you comment the 44th line ($Rtn = Dir("SPSM_*.mod")) and uncomment the 45th line, nt4 will run it fine. Also, if you alternate the comment on the 98th and 99th lines, as well as the next Dir() lines, you will see the having an index fixes this.
Sorry about the lengthy post, but I am trying to be as thorough as possible for anyone willing to help me out. Thanks again!

-Morbid

code:

; **********************************
; **** ServerPS.kix v5.3 ****
; **** Check servers for Procs ****
; **** ****
; **** -Created by Scott Jones ****
; **** ****
; **** Date Started: 04.19.2001 ****
; **** Last Updated: 10.26.2001 ****
; **********************************

Break On

Color y+/n
CLS

$DimX = 54
$DimY = 26

Shell "%ComSpec% /c mode con: cols=" + $DimX + " lines=" + $DimY
Box(0, 0, $DimY - 1, $DimX - 2, "single") ; Outter edge


;//// Begin: Stuff \\\\
$Version = "v5.3"
$LogDir = "C:\Temp\ServerPS_Logs"
$Process = "DRWTSN32"
$Comment = ";"
$Sweep = 1
$StartDate = @DATE
$StartTime = @TIME
If $DelayTime < 1
$DelayTime = 15
EndIf
If $Alert <> 1
$Alert = 0
EndIf
$Tickr = 0
At($DimY - 1, 2) "["
At($DimY - 1, 12 + Len($Version)) "]"
Color c+/c
At($DimY - 1, 3) "ServerPS " + $Version
Color y+/n

$Rtn = Dir("SPSM_*.mod")
;$Rtn = "SPSM_Web.mod"
;If $Rtn = ""
; Box($DimY - 23, $DimX / 2 - 10, $DimY - 21, $DimX - 18, "double")
; Color r+/r
; At($DimY - 22, $DimX / 2 - 9) " No module found! "
; Goto "End"
;EndIf

$ModName = SubStr($Rtn, 6, Len($Rtn) - 9)

;$ModState = 0
;Call "SPSM_" + $ModName + ".mod"
;If $SPSDir = ""
; Box($DimY - 23, $DimX / 2 - 18, $DimY - 21, $DimX - 10, "double")
; Color r+/r
; At($DimY - 22, $DimX / 2 - 17) " Module not correctly configured! "
; Goto "End"
;EndIf

At($DimY - 1, $DimX - 13 - Len($ModName)) "["
At($DimY - 1, $DimX - 4) "]"
Color c+/c
At($DimY - 1, $DimX - 12 - Len($ModName)) "Module: " + $ModName
Color w+/c
At($DimY - 1, $DimX - 6 - Len($ModName)) ":"
Color y+/n


;// Begin: Configuration Menu \\
If $FileConf <> ""
Goto "DomainCheck"
EndIf
$a = SetTitle("ServerPS: Config Menu")
$Rtn = Dir("SPS_*.ini")
If $Rtn = ""
Box($DimY - 23, $DimX / 2 - 13, $DimY - 21, $DimX - 15, "double")
Color r+/r
At($DimY - 22, $DimX / 2 - 12) " No config files found! "
Goto "End"
EndIf

$Counter = 0
$Rtn = Dir("SPS_*.ini")
While $Rtn <> "" AND @ERROR = 0
$Counter = $Counter + 1
$Rtn = Dir()
Loop

Dim $ConfigName[$Counter]
Dim $ConfigTime[$Counter]
Dim $ConfigInUse[$Counter]

$z = 0
$Rtn = Dir("SPS_*.ini")
;$Rtn = Dir("SPS_*.ini",1)
While $z < $Counter AND $Rtn <> ""
$ConfigName[$z] = SubStr($Rtn, 5, Len($Rtn) - 8)
$ConfigTime[$z] = GetFileTime($Rtn)
$a = Open(1, $SPSDir + "lock_" + $ConfigName[$z], 2)
If $a = 32
$ConfigInUse[$z] = "Yes"
Else
$ConfigInUse[$z] = "No"
$a = Close(1)
EndIf
$z = $z + 1
$Rtn = Dir("")
; $Rtn = Dir("",1)
Loop

Box(0, 0, 2, $DimX - 2, "single") ; Top box
At(1,1) "Select configuration file (1-" + $Counter + "):"
At(4,3) "#"
At(4,7) "Config File"
At(4,23) "In-Use"
At(4, $DimX - 22) "Last Modified"

$z = 0
While $z < $Counter
At(5 + $z, 2) "( )"
If $ConfigInUse[$z] = "Yes"
Color r/n+
Else
Color w+/n
EndIf
At(5 + $z, 3) 1 + $z
If $ConfigInUse[$z] = "Yes"
Color r/n+
Else
Color g+/n
EndIf
At(5 + $z, 7) $ConfigName[$z]
At(5 + $z, 23) $ConfigInUse[$z]
At(5 + $z, $DimX - 22) $ConfigTime[$z]
Color y+/n
$z = $z + 1
Loop

:ConfigMenu
At(1, 33 + Len($Counter)) Get $z

Select
Case $z = Chr(3) OR $z = Chr(27)
Quit
Case $z > 0 AND $z <= $Counter
If $ConfigInUse[-1 + $z] = "Yes"
At(1, 33 + Len($Counter)) " "
Goto "ConfigMenu"
EndIf
$FileConf = $ConfigName[-1 + $z]
$FileTimeNew = $ConfigTime[-1 + $z]
Case 1
At(1, 33 + Len($Counter)) " "
Goto "ConfigMenu"
EndSelect

$z = 0
While $z <= $Counter
At(4 + $z, 2) " "
At(4 + $z, 7) " "
$z = $z + 1
Loop
;\\ End: Configuration Menu //


:DomainCheck
$a = Open(1, $SPSDir + "lock_" + $FileConf, 2)
If $a = 32
Box($DimY - 23, $DimX / 2 - 11, $DimY - 21, $DimX - 16, "double")
Color r+/r
At($DimY - 22, $DimX / 2 - 10) " Config file in use! "
Goto "End"
Else
$a = Close(1)
EndIf

If $FileTimeNew = ""
$FileTimeNew = GetFileTime("SPS_" + $FileConf + ".ini")
EndIf

$a = Open(1, "SPS_" + $FileConf + ".ini")
$Domain = ReadLine(1)
$a = Close(1)

$Title = "ServerPS $Version: $FileConf"
$FileTemp = "C:\Temp\" + $FileConf + "-" + @USERID + ".txt"
;\\\\ End: Stuff ////


At($DimY - 1, 2) "["
At($DimY - 1, 3 + Len($Title)) "]"
Color c+/c
At($DimY - 1, 3) $Title
Color y+/n

If Exist($LogDir) = 0
MD $LogDir
If @ERROR <> 0
Color r+/r
At(1,1) "Could not create Logs Dir..."
Goto "End"
EndIf
EndIf

$ModState = 1
Call "SPSM_" + $ModName + ".mod"

If $UserName <> ""
Box(0, 0, 2, $DimX - 2, "single") ; Top box
$User = $Domain + "\" + $UserName
Goto "PassGet"
EndIf


;//// Begin: User selection \\\\
$a = SetTitle("ServerPS: Select User")
Box(0, 0, 2, $DimX - 2, "single") ; Top box

$UserName = ""
$UserChr = ""
$UserAsc = 0
At(1,1) UCase($Domain) + " Username:"
Color y/n
At(2,1) "[Default = " + @USERID + "]"
Color y+/n

While $UserAsc <> 13
At(1, Len($Domain) + 12) " "
Color r+/n
At(1, Len($Domain) + 12) $UserName
At(1, Len($Domain) + Len($UserName) + 12) Get $UserChr
$UserAsc = Asc($UserChr)
Select
Case $UserAsc = 8
If Len($UserName) > 0
$UserName = SubStr($UserName, 1, Len($UserName) - 1)
EndIf
Case $UserAsc = 3 OR $UserAsc = 27
Quit
Case $UserAsc <> 13
$UserName = $UserName + $UserChr
EndSelect
Color y+/n
Loop

If Len($UserName) = 0
$UserName = @USERID
EndIf

Color y+/n
$User = $Domain + "\" + $UserName
At(0,0)
;\\\\ End: User selection ////


;//// Begin: Password section \\\\
$a = SetTitle("ServerPS: Enter Password")
Box(0, 0, 2, $DimX - 2, "single") ; Top box

:PassGet
$Password = ""
$Passwyrd = ""
$PassChr = ""
$PassAsc = 0
$PassLen = 0
At(1,1) UCase($User) + " Password:"

While $PassAsc <> 13
At(1, Len($User) + 12) " "
Color r+/n
At(1, Len($User) + 12) $Passwyrd
At(1, Len($User) + 12 + $PassLen) Get $PassChr
$PassAsc = Asc($PassChr)
Select
Case $PassAsc = 8
If $PassLen > 0
$Passwyrd = SubStr($Passwyrd, 1, $PassLen - 1)
$Password = SubStr($Password, 1, $PassLen - 1)
$PassLen = $PassLen - 1
EndIf
Case $PassAsc = 3 OR $PassAsc = 27
Quit
Case $PassAsc <> 13
$Passwyrd = $Passwyrd + "x"
$Password = $Password + $PassChr
$PassLen = $PassLen + 1
EndSelect
Color y+/n
Loop

At(1, Len($User) + 12) "(Verifying...) "
At(0,0)
$a = Open(1, "SPS_" + $FileConf + ".ini")
$Rtn = ReadLine(1)
$Rtn = ReadLine(1)
$Rtn = ReadLine(1)
$a = Close(1)
$a = "z"

:PassVerify
Use $a + ":" "\\" + $Rtn + "\c$" /user:$User /password:$Password
$z = @ERROR

At(1, Len($User) + 12) " "
Color r+/r
Select
Case $z = 0
Use $a + ":" /delete
Color g+/n
At(1, Len($User) + 12) "(Accepted)"
Case $z = 1326
At(1, Len($User) + 12) "(Invalid password!)"
Color y+/n
At(0,0)
Sleep 5
Goto "PassGet"
Case $z = 53
At(1, Len($User) + 12) "(Check server not found!)"
Goto "End"
Case $z = 67
At(1, Len($User) + 12) "(Check share invalid!)"
Goto "End"
Case $z = 85
If $a = "z"
$a = "x"
Goto "PassVerify"
Else
At(1, Len($User) + 12) "(Cannot verify password!)"
Goto "End"
EndIf
Case 1
At(1, Len($User) + 12) "(Unknown error!)"
Goto "End"
EndSelect
Color y+/n
At(0,0)
Sleep 1
;\\\\ End: Password section ////


$a = SetTitle("ServerPS: Launching...")
Big
At(4,3) "Server"
At(12,11) "Proc"
Small
At(18,42) "- $Version"
Color w+/n
At($DimY - 2, $DimX - 25) "-written by Scott Jones"
Color y+/n
At(0,0)
Sleep 2

GoSub "CnfRefresh1"


;//// Begin: Error arrays \\\\
$MaxErrors = $TotalCount
Global $ErrorIndex[$MaxErrors]
Global $ErrorHost[$MaxErrors]
Global $ErrorTime[$MaxErrors]
Global $ErrorPS[$MaxErrors]

$z = 0
While $z < $MaxErrors
$ErrorIndex[$z] = "9999999"
$ErrorHost[$z] = ""
$ErrorTIme[$z] = ""
$ErrorPS[$z] = ""
$z = $z + 1
Loop
;\\\\ End: Error arrays ////


;//// Begin: Prep Log File \\\\
$a = RedirectOutput($LogDir + "\" + $FileConf + "-" + SubStr(@DATE, 1, 4) + "." + SubStr(@DATE, 6, 2) + "." + SubStr(@DATE, 9, 2) + ".log")
?
? "--------"
? @TIME + " - ServerPS $Version started by " + @USERID + "."
$a = RedirectOutput("")
;\\\\ End: Prep Log File ////


;//// Begin: Main section \\\\
$DimX = 54
$DimY = 6

Shell "%ComSpec% /c mode con: cols=" + $DimX + " lines=" + $DimY
$a = SetTitle("[0] " + $Title)

Box($DimY - 2, 0, $DimY - 1, $DimX - 2, "single") ; Bottom Box
Box(0, $DimX - 30, 2, $DimX - 2, "single") ; Upper-right box
Box(0, 0, 2, 24, "single") ; Upper-left box
Box(2, 0, 4, $DimX - 2, "double") ; Current box

;Redraw Title
At($DimY - 1, 2) "["
At($DimY - 1, 3 + Len($Title)) "]"
Color c+/c
At($DimY - 1, 3) $Title
Color y+/n

Color g+/g
At(1,1) " " + $StartDate + " " + $StartTime + " "
At(1, $DimX - 29) " Servers: "
At(1, $DimX - 14) " Sweep: "
Color y+/g
At(1,13) "|"
At(1,39) "|"
Color g+/n
At(3,1) "Current:"
Color y+/n

At($DimY - 1, $DimX - 13) "[ ]"
Color c+/c
At($DimY - 1, $DimX - 12) "0 Errors"
Color y+/n

At($DimY - 1, Len($Title) + 6) "[ ]"
$Problems = 0
GoSub "SPSInfo"

$a = Open(5, $SPSDir + "lock_" + $FileConf, 5)
$ModState = 2
Call "SPSM_" + $ModName + ".mod"


:Top
GoSub "SPSInfo"
Color g+/g
At(1, $DimX - 19) $SrvCount
If $Sweep < 100
At(1, $DimX - 6) $Sweep
Else
At(1, $DimX - 6) ">99"
EndIf

Color y+/n
At(3,10) " "
$ProcNum = 0
$SrvNum = 0
While $SrvNum < $SrvCount
GoSub "Ticker"
If $ProcNum < $TotalCount
$ProcCount = 0
$z = 0
While $z < 1 AND @ERROR = 0 AND $ProcNum + $ProcCount < $TotalCount
If $MainServer[$ProcNum] = $MainServer[$ProcNum + $ProcCount]
$MainError[$ProcNum + $ProcCount] = 0
$ProcCount = $ProcCount + 1
Else
$z = 1
EndIf
Loop
Else
$ProcCount = 1
EndIf
$SrvCurrent = $SrvNum + 1

Color g+/n
At(3,10) "$SrvCurrent - " + $MainServer[$ProcNum] + " "
Color y+/n
At(0,0)
Shell "%ComSpec% /c pslist \\" + $MainServer[$ProcNum] + " -u " + $User + " -p " + $Password + " >" + $FileTemp
$a = Open(1, $FileTemp)
$z = 0
While $z < 6
$Rtn = ReadLine(1)
$z = $z + 1
Loop
If InStr($Rtn, "Failed") > 0
$a = Close(1)

Shell "%ComSpec% /c nbtstat -a " + $MainServer[$ProcNum] + " >" + $FileTemp
$a = Open(1, $FileTemp)
$Rtn = ReadLine(1)
$a = Close(1)
If InStr($Rtn, "found") > 0
$Message = "Server down"
Else
$Message = "Error grabbing ps"
EndIf

GoSub "LogDisplay"
Goto "MainSkip"
EndIf
$z = 0
While $z < 10
$Rtn = ReadLine(1)
$z = $z + 1
Loop
While $Rtn <> ""
If InStr($Rtn, $Process) > 0
$Message = $Process + " found"
$MainError[- 1 + $ProcNum + $ProcCount] = 1
GoSub "LogDisplay"
Else
$z = 0
While $z < $ProcCount
If InStr($Rtn, $MainProc[$ProcNum + $z]) > 0 AND $MainProc[$ProcNum + $z] <> ""
$MainError[$ProcNum + $z] = 1
$y = 0
While $y < $MaxErrors
If $ErrorHost[$y] = $MainServer[$ProcNum + $z] AND InStr($ErrorPS[$y], $MainProc[$ProcNum + $z]) > 0
$Message = $MainProc[$ProcNum + $z] + " restored"
GoSub "Sort"
$y = $MaxErrors
Else
$y = $y + 1
EndIf
Loop
$z = $ProcCount
Else
$z = $z + 1
EndIf
Loop
EndIf
$Rtn = ReadLine(1)
Loop
$a = Close(1)

$z = 0
While $z < $ProcCount
If $MainError[$ProcNum + $z] = 0 AND $MainProc[$ProcNum + $z] <> ""
$Message = $MainProc[$ProcNum + $z] + " not found"
GoSub "LogDisplay"
EndIf
$z = $z + 1
Loop

$y = 0
While $y < $MaxErrors
If $ErrorHost[$y] = $MainServer[$ProcNum]
Select
Case $ErrorPS[$y] = $Process + " found" AND $MainError[-1 + $ProcNum + $ProcCount] = 0
$Message = "DRWTSN32 cleared"
GoSub "Sort"
Case $ErrorPS[$y] = "Server down"
$Message = "Server back up"
GoSub "Sort"
Case $ErrorPS[$y] = "Error grabbing ps"
$Message = "Successfull ps"
GoSub "Sort"
EndSelect
EndIf
$y = $y + 1
Loop


:MainSkip
Del $FileTemp
$SrvNum = $SrvNum + 1
$ProcNum = $ProcNum + $ProcCount
Loop

$z = 0
While $z <> $ProcCount
$MainError[$z] = 0
$z = $z + 1
Loop

$Sweep = $Sweep + 1

GoSub "CnfRefresh1"
Goto "Top"
;\\\\ End: Main section ////

:End
At(0,0)
Sleep 5
Quit


; **** Sub-Routines ****

;//// Begin Subroutine: Logging to file \\\\
:LogDisplay
$m = 0
While $m < $MaxErrors
If $ErrorHost[$m] = $MainServer[$ProcNum] AND InStr($ErrorPS[$m], $Message) > 0
Goto "Log2"
EndIf
If $ErrorHost[$m] = $MainServer[$ProcNum] AND (($ErrorPS[$m] = "Server down" AND $Message = "Error grabbing ps") OR ($ErrorPS[$m] = "Error grabbing ps" AND $Message =

"Server down"))
$y = $m
$MessageTemp = $Message
GoSub "Sort"
$Message = $MessageTemp
EndIf
$m = $m + 1
If $m = $MaxErrors
$n = 0
While $n < $MaxErrors
If $ErrorHost[$n] = ""
$ErrorIndex[$n] = "$Sweep" + SubStr(@TIME, 1, 2) + SubStr(@TIME, 4, 2) + SubStr(@TIME, 7, 2)
$ErrorHost[$n] = $MainServer[$ProcNum]
$ErrorTime[$n] = @TIME
$ErrorPS[$n] = $Message
$Problems = $Problems + 1
$a = SetTitle("[" + $Problems + "] " + $Title)
At($DimY - 1, $DimX - Len("$Problems") - 13) "-["
Color c+/c
At($DimY - 1, $DimX - Len("$Problems") - 11) $Problems
Color y+/n

$ErrorMsg = $MainServer[$ProcNum]
While Len($ErrorMsg) < 16
$ErrorMsg = $ErrorMsg + " "
Loop

$a = RedirectOutput($LogDir + "\" + $FileConf + "-" + SubStr(@DATE, 1, 4) + "." + SubStr(@DATE, 6, 2) + "." + SubStr(@DATE, 9, 2) + ".log")
? @TIME + " - " + $ErrorMsg + " : " + $Message
$a = RedirectOutput("")
If $Alert = 1
Shell "%ComSpec% /c net send @WKSTA " + $MainServer[$ProcNum] + " : " + $Message + " >NUL"
EndIf

GoSub "SPSInfo"
Goto "Log2"
Else
$n = $n + 1
EndIf
Loop
EndIf
Loop

:Log2
Return
;\\\\ End Subroutine: Logging to screen and file ////

;//// Begin Subroutine: Sorting, clearing and redraw \\\\
:Sort
$ErrorIndex[$y] = "9999999"
$ErrorHost[$y] = ""
$ErrorTime[$y] = ""
$ErrorPS[$y] = ""
$Problems = $Problems - 1


;// Begin: Sorting \\
$Bad = 0
$s = 0
$t = 0
While $Bad < 2
If $s = 0
$Bad = 0
EndIf
$t = $s + 1
If $ErrorIndex[$s] > $ErrorIndex[$t]
$ErrorTemp1 = $ErrorIndex[$s]
$ErrorTemp2 = $ErrorHost[$s]
$ErrorTemp3 = $ErrorTime[$s]
$ErrorTemp4 = $ErrorPS[$s]

$ErrorIndex[$s] = $ErrorIndex[$t]
$ErrorHost[$s] = $ErrorHost[$t]
$ErrorTime[$s] = $ErrorTime[$t]
$ErrorPS[$s] = $ErrorPS[$t]

$ErrorIndex[$t] = $ErrorTemp1
$ErrorHost[$t] = $ErrorTemp2
$ErrorTime[$t] = $ErrorTemp3
$ErrorPS[$t] = $ErrorTemp4

$Bad = 1
Else
If $Bad = 0 AND $t = -1 + $MaxErrors
$Bad = 2
EndIf
EndIf
If $t = -1 + $MaxErrors
$s = 0
Else
$s = $s + 1
EndIf
Loop
;\\ End: Sorting //


$a = SetTitle("[" + $Problems + "] " + $Title)
At($DimY - 1, $DimX - Len("$Problems") - 13) "-["
Color c+/c
At($DimY - 1, $DimX - Len("$Problems") - 11) $Problems
Color y+/n

If $ProcNum = $TotalCount
$ErrorMsg = $TmpMainServer[$z]
Else
$ErrorMsg = $MainServer[$ProcNum]
EndIf
While Len($ErrorMsg) < 16
$ErrorMsg = $ErrorMsg + " "
Loop

$a = RedirectOutput($LogDir + "\" + $FileConf + "-" + SubStr(@DATE, 1, 4) + "." + SubStr(@DATE, 6, 2) + "." + SubStr(@DATE, 9, 2) + ".log")
? @TIME + " - " + $ErrorMsg + " : " + $Message
$a = RedirectOutput("")

GoSub "SPSInfo"

Return
;\\\\ End Subroutine: Sorting, clearing and redraw ////

;//// Begin Subroutine: Refresh Config list \\\\
:CnfRefresh1

If $Sweep > 1
$FileTimeOld = $FileTimeNew
$FileTimeNew = GetFileTime("SPS_" + $FileConf + ".ini")
If $FileTimeNew = $FileTimeOld
At(3,10) "(Done, Stalling for"
$z = 0
While $z <> $DelayTime
GoSub "Ticker"
$y = $DelayTime - $z
At(3,30) "$y Secs) "
At(0,0)
Sleep 1
$z = $z + 1
Loop
Return
EndIf
Color c+/n
At(3,10) "(Reloading Config: Stage 1)"
Color y+/n
At(0,0)
$TmpSrvCount = $SrvCount
$TmpTotalCount = $TotalCount

ReDim $TmpMainServer[$TmpTotalCount]
ReDim $TmpMainProc[$TmpTotalCount]

$z = 0
While $z < $TmpTotalCount
$TmpMainServer[$z] = $MainServer[$z]
$TmpMainProc[$z] = $MainProc[$z]
$z = $z + 1
Loop
Else
Global $TmpMainServer[1]
Global $TmpMainProc[1]
EndIf


;// Begin: Server/Process count \\
If $Sweep > 1
Color c+/n
At(3,35) "2"
Color y+/n
At(0,0)
EndIf
$SrvCount = 0
$ProcCount = 0
$a = Open(1, "SPS_" + $FileConf + ".ini")
$Rtn = ReadLine(1)
$Rtn = ReadLine(1)
While @ERROR = 0
$Rtn = ReadLine(1)
If $Rtn <> ""
If $Sweep = 1
GoSub "LoadMsg"
EndIf
$Server = $Rtn
If SubStr($Server, 1, 1) <> $Comment
$SrvCount = $SrvCount + 1
EndIf
While $Rtn <> ""
$Rtn = ReadLine(1)
If SubStr($Server, 1, 1) <> $Comment AND SubStr($Rtn, 1, 1) <> $Comment
$ProcCount = $ProcCount + 1
EndIf
Loop
EndIf
Loop
$a = Close(1)
$TotalCount = $ProcCount
;\\ End: Server/Process count //


;// Begin: Build Server/Process array \\
If $Sweep > 1
Color c+/n
At(3,35) "3"
Color y+/n
At(0,0)
EndIf
If $Sweep = 1
Global $MainServer[$TotalCount]
Global $MainProc[$TotalCount]
Global $MainError[$TotalCount]
Else
ReDim $MainServer[$TotalCount]
ReDim $MainProc[$TotalCount]
ReDim $MainError[$TotalCount]
EndIf
$a = Open(1, "SPS_" + $FileConf + ".ini")
$Rtn = ReadLine(1)
$Rtn = ReadLine(1)
$z = 0
While $z < $TotalCount
If $Sweep = 1
GoSub "LoadMsg"
EndIf
$Rtn = ReadLine(1)
$Server = $Rtn
While $Rtn <> ""
$Rtn = ReadLine(1)
If SubStr($Server, 1, 1) <> $Comment AND SubStr($Rtn, 1, 1) <> $Comment
$MainServer[$z] = $Server
$MainError[$z] = 0
$MainProc[$z] = $Rtn
$z = $z + 1
EndIf
Loop
Loop
$a = Close(1)
;\\ End: Build Server/Process array //


If $Sweep > 1
$z = 0
While $z < $TmpTotalCount
Color c+/n
At(3,35) "4 | " + $z + " - " + $TmpTotalCount + ")"
Color y+/n
At(0,0)

$y = 0
While $y < $TotalCount
If $TmpMainServer[$z] = $MainServer[$y] AND $TmpMainProc[$z] = $MainProc[$y]
Goto "CnfRefresh2"
EndIf
$y = $y + 1
Loop

$y = 0
While $y < $MaxErrors
If $ErrorHost[$y] = $TmpMainServer[$z] AND InStr($ErrorPS[$y], $TmpMainProc[$z]) > 0
$ProcNum = $TotalCount
$Message = "removed from list"
GoSub "Sort"
$y = $MaxErrors
Else
$y = $y + 1
EndIf
Loop

:CnfRefresh2
$z = $z + 1
Loop
EndIf

Return
;\\\\ End Subroutine: Refresh Config list ////

;//// Begin Subroutine: Output info to .sps file \\\\
:SPSInfo
Do
$a = RedirectOutput($SPSDir + "SPSo_" + $FileConf + ".sps", 1)
Until $a = 0
? $SrvCount
? $StartDate
? $StartTime
? $Sweep
? $Problems
$m = 0
While $m < $Problems
? $ErrorTime[$m]
? $ErrorHost[$m]
? $ErrorPS[$m]
$m = $m + 1
Loop
$a = RedirectOutput("")
Return
;\\\\ End Subroutine: Output info to .sps file ////

;//// Begin Subroutine: Loading Message \\\\
:LoadMsg

Select
Case $m = 0
$Loading = "lOADING"
Case $m = 1
$Loading = "LoADING"
Case $m = 2
$Loading = "LOaDING"
Case $m = 3
$Loading = "LOAdING"
Case $m = 4
$Loading = "LOADiNG"
Case $m = 5
$Loading = "LOADInG"
Case $m = 6
$Loading = "LOADINg"
EndSelect

Color c+/n
At($DimY - 5, $DimX / 2 - 3) $Loading
Color y+/n
At(0,0)

$m = $m + 1
If $m = 7
$m = 0
EndIf

Return
;\\\\ End Subroutine: Loading Message ////

;//// Begin Subroutine: Ticker \\\\
:Ticker

Select
Case $Tickr = 0
$Tick = "|"
Case $Tickr = 1
$Tick = "/"
Case $Tickr = 2
$Tick = "-"
Case $Tickr = 3
$Tick = "\"
EndSelect

Color y/n
At($DimY - 1, Len($Title) + 7) $Tick
Color y+/n
At(0,0)

If $Tickr = 3
$Tickr = 0
Else
$Tickr = $Tickr + 1
EndIf

Return
;\\\\ End Subroutine: Ticker ////