Jump to content
OldGuyWalking

_ArrayDisplay blanking out

Recommended Posts

OldGuyWalking

When I use the _ArrayDisplay UDF it displays the data from the array and then within 10 seconds or so it will blank all of the rows in the grid. The data is still there and so is the frame of the GUI just the grid blanks out. There are no error messages and everything runs fine except for the data disappearing.

I can refresh the data by using the arrow keys to move down the rows to get it to redisplay the data.

The only time this happens is on my multi-monitor setup, including if I remote into that desktop. It has not been a problem on either my laptop or an older single monitor XP machine.

It will repeat the blanking behavior about every 10 to 30 seconds. Maximizing the GUI or moving it to another monitor does not make any difference.

Has this happened to anyone else using a multi-monitor setup or does anyone have a suggestion or workaround?

I have no idea where to begin to determine what the problem is so if I've left out any needed information please ask and I'll be happy to provide.

If relevant -

Windows 7 Professional  V6.1  Build 7601  
Intel Core i5 Quad 3.40GHz
Memory 16GB

GeForce GTX 660
NVIDIA NVAPI Library, Version 347.88

AutoIt v3.3.14.0 (clean on 7/11/15)

Thanks,

Bill

Edited by OldGuyWalking
spell check

Share this post


Link to post
Share on other sites
BrewManNH

Are you using this inside a windows message handler function, called by using GUIRegisterMsg?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
AutoBert

Are you using _ArrayDisplay in a func registered with GuiRegisterMSG?

Please show your script for better help.

Share this post


Link to post
Share on other sites
jchd

Seemingly unrelated question: do you use Logitech mice/keyboards drivers on the failling machine? If yes, try temporarily disabling that.

  • Like 1

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
OldGuyWalking

I don't know what could be causing your problem, but just a relevant question if I may.

Has this only occurred after installing 3.3.14.0?

JohnOne - No. Been using an older version of portable AutoIT for a couple of years. Same problem occurred with it. One of the reasons I'd upgraded to the recently released installed version was to see if that fixed this issue.

Are you using this inside a windows message handler function, called by using GUIRegisterMsg?

BrewManNH & AutoBert - No. See code below. I read in data from the clipboard into an array. I'm using _ArrayDisplay to check the results after doing various actions to the array to make sure the RegEx is working as expected. There's more to the code but it's pretty repetitive. Do something to the data and then display the array to verify.

;#include <MsgBoxConstants.au3>
#include <array.au3>

; Copy TV show list from clipboard.

Dim $sShowlist
Dim $ArrayList
Dim $n1
Dim $n2
Dim $iDeleteIndex
Dim $aDeleteIndex
Dim $bFlag = False
Dim $sSection1
Dim $sPattern
Dim $sJunkText
Dim $aUnique1
Dim $aUnique2
Dim $aUnique3
Dim $sErrMsg
Dim $iErrCode
Dim $iPosStart
Dim $iPosEnd
Dim $sResult
Dim $iErr
Dim $iExt

#comments-start
    Error Codes for ClipGet
    1 = if clipboard is empty
    2 = if contains a non-text entry.
    3 or 4 = if cannot access the clipboard.
#comments-end

$ArrayList = StringSplit(GetClip(), @CR)

If $ArrayList[0] < 1 Then
    $sErrMsg = "Not Enough Records"
    MsgBox(0, "Error", $sErrMsg)
    Exit
EndIf

; MsgBox(0, "Records", "Record Count = " & $ArrayList[0])
; _ArrayDisplay($ArrayList, "Unchanged List")

; Delete Leading Whitespace in array
For $n1 = 1 To $ArrayList[0]
    $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 1)
Next
; _ArrayDisplay($ArrayList, "Leading Whitespace cleared")

; Delete unneeded records
For $n1 = 1 To $ArrayList[0]
    $sPattern = "^RE:"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "^REQ:"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "(.+)(sample\-|\.sample\.)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "(.+)(proof\-|\.proof\.)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
Next
ArrayMarkBlanksforDeletion($ArrayList)
ArrayDeleteRows($ArrayList)
$ArrayList[0] = UBound($ArrayList) - 1
_ArrayDisplay($ArrayList, "First cleanup")

Seemingly unrelated question: do you use Logitech mice/keyboards drivers on the failling machine? If yes, try temporarily disabling that.

jchd - Yes,  I use wireless Logitech mice and keyboards on all 3 of the machines (including my laptop).  I'd disable it on the multimonitor machine but  I don't have a wired keyboard or mouse. Note though that I'm not having any problem with this issue on either the laptop or the single display machine and no other problem on the multi-monitor machine.

Bill

 

Edited by OldGuyWalking

Share this post


Link to post
Share on other sites
BrewManNH

Do you have a working (runnable) script?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
OldGuyWalking

Do you have a working (runnable) script?

The data the script works on is data I copy to the clipboard from a third party app. The script will be runnable but will not provide any information if you don't have the third party app and a way to copy the specific filtered data to your clipboard before running the script.

However, I've included the complete script in case seeing the code will provide any useful information.

(Note: I wrote this only for the purpose of learning how to apply various RegEx patterns in AutoIt in order to extract data from a set of records. It's not pretty but it runs fine on my machine, except for the _ArrayDisplay issue.)

Bill

#include <MsgBoxConstants.au3>
#include <array.au3>

; Copy TV show list from clipboard.

Dim $sShowlist
Dim $ArrayList
Dim $n1
Dim $n2
Dim $iDeleteIndex
Dim $aDeleteIndex
Dim $bFlag = False
Dim $sSection1
Dim $sPattern
Dim $sJunkText
Dim $aUnique1
Dim $aUnique2
Dim $aUnique3
Dim $sErrMsg
Dim $iErrCode
Dim $iPosStart
Dim $iPosEnd
Dim $sResult
Dim $iErr
Dim $iExt

#comments-start
    Error Codes for ClipGet
    1 = if clipboard is empty
    2 = if contains a non-text entry.
    3 or 4 = if cannot access the clipboard.
#comments-end

$ArrayList = StringSplit(GetClip(), @CR)

If $ArrayList[0] < 1 Then
    $sErrMsg = "Not Enough Records"
    MsgBox(0, "Error", $sErrMsg)
    Exit
EndIf

; MsgBox(0, "Records", "Record Count = " & $ArrayList[0])
; _ArrayDisplay($ArrayList, "Unchanged List")

; Delete Leading Whitespace in array
For $n1 = 1 To $ArrayList[0]
    $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 1)
Next
; _ArrayDisplay($ArrayList, "Leading Whitespace cleared")

; Delete unneeded records
For $n1 = 1 To $ArrayList[0]
    $sPattern = "^RE:"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "^REQ:"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "(.+)(sample\-|\.sample\.)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "(.+)(proof\-|\.proof\.)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
Next
ArrayMarkBlanksforDeletion($ArrayList)
ArrayDeleteRows($ArrayList)
$ArrayList[0] = UBound($ArrayList) - 1
; _ArrayDisplay($ArrayList, "First cleanup")

For $n1 = 1 To $ArrayList[0]
    ; $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.d{4}\.[Ss][0-9][0-9][eE][0-9][0-9]\.|\.[Ss][0-9][0-9][eE][0-9][0-9]\.|\.\d{4}\.|\.\d\d\.|\.720p|\.1080p|\.HDTV|\.PDTV|\.DVD|S[0-9][0-9]\.)(.+)"

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.d{4}\.[Ss][0-9][0-9][eE][0-9][0-9]\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.[Ss][0-9][0-9][eE][0-9][0-9]\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.\d{4}\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.\d{2}\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.720p|\.1080p|\.HDTV|\.PDTV|\.DVD\.|x264)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.S[0-9][0-9]\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

Next
; _ArrayDisplay($ArrayList, "First List")

; Remove brackets, periods, and underscores from string and trim whitespace from front and back of String.
For $n1 = 1 To $ArrayList[0]

    $ArrayList[$n1] = StringReplace($ArrayList[$n1], "[", "", 1)
    $ArrayList[$n1] = StringReplace($ArrayList[$n1], " ]", "", 1)
    $ArrayList[$n1] = StringReplace($ArrayList[$n1], ".", " ")
    $ArrayList[$n1] = StringReplace($ArrayList[$n1], "_", " ")
    $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 3)
    If StringRight($ArrayList[$n1], 1) = "-" Then
        $ArrayList[$n1] = StringTrimRight($ArrayList[$n1], 1)
        $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 3)
    EndIf

Next
; _ArrayDisplay($ArrayList, "Cleanup #1")

; Remove non-title related text
$sJunkText = FileToArray(@ScriptDir & "\JunkData.txt")
;_ArrayDisplay($sJunkText)
If IsArray($sJunkText) Then
    $sJunkText = ArraySortByLen($sJunkText, 1, 0, UBound($sJunkText))
    ;_ArrayDisplay($sJunkText)
    For $n2 = 0 To UBound($sJunkText) - 1
        For $n1 = 1 To $ArrayList[0]
            $ArrayList[$n1] = StringReplace($ArrayList[$n1], " " & $sJunkText[$n2], "", Default, 1)
            $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 3)
        Next
    Next
EndIf
; _ArrayDisplay($ArrayList, "Cleanup #2")

; Sort the list.
_ArraySort($ArrayList, Default, 1)
_ArrayDisplay($ArrayList, "Sorted")

; Remove duplicates from the list.
$aUnique1 = _ArrayUnique($ArrayList, 0, 1, 0, 1)
; _ArrayDisplay($aUnique1, "DeDuplicated")

$aUnique2 = $aUnique1
; Summary List by Title, Season, Episode
$sPattern = "(.*?)([sS])([0-9][0-9])([eE])([0-9][0-9])(.*+)"
For $n1 = 1 To $aUnique2[0]
    $iErrCode = StringRegExp($aUnique2[$n1], "(.*?)([sS])([0-9][0-9])([eE])([0-9][0-9])(.*?)", 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique2[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique2[$n1] = StringRegExpReplace($aUnique2[$n1], $sPattern, "\1- \3x\5 - \6")
        $aUnique2[$n1] = StringStripWS($aUnique2[$n1], 3)
        If StringRight($aUnique2[$n1], 1) = "-" Then
            $aUnique2[$n1] = StringTrimRight($aUnique2[$n1], 1)
            $aUnique2[$n1] = StringStripWS($aUnique2[$n1], 3)
        EndIf
    EndIf
    If @error Then
        $iErr = @error
        $iExt = @extended
        ; ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
        MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
    EndIf
Next
_ArrayDisplay($aUnique2, "Unduplicated List with Season, Episode, and title (if available)")

$aUnique3 = $aUnique1
; Remove yyyy.mm.dd entries
$sPattern = "(.*?)(\d{4}(\s|\.)\d{2}(\s|\.)\d{2})(.*+)"
For $n1 = 1 To $aUnique3[0]
    $iErrCode = StringRegExp($aUnique3[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique2[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique3[$n1] = StringRegExpReplace($aUnique3[$n1], $sPattern, "\1")
        If @error Then
            $iErr = @error
            $iExt = @extended
            ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
            MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
        EndIf
        $aUnique3[$n1] = StringStripWS($aUnique3[$n1], 3)
    EndIf
Next
; _ArrayDisplay($aUnique3, "Strip yyyy.dd.mm from entries")

$aUnique4 = $aUnique3

; Create List for NB Filter
$sPattern = "(.*?)([sS])([0-9][0-9])([eE])([0-9][0-9])(.*+)"
For $n1 = 1 To $aUnique3[0]
    $iErrCode = StringRegExp($aUnique3[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique2[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique3[$n1] = StringRegExpReplace($aUnique3[$n1], $sPattern, "\1")
        If @error Then
            $iErr = @error
            $iExt = @extended
            ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
            MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
        EndIf
        $aUnique3[$n1] = StringStripWS($aUnique3[$n1], 3)
        $aUnique3[$n1] = $aUnique3[$n1] & ".+s[0-9][0-9]"
    EndIf
    $aUnique3[$n1] = StringReplace($aUnique3[$n1], " ", ".")
Next
; _ArrayDisplay($aUnique3, "Setup for NB filter")

; Remove duplicates from the NB filter list.
$aUnique3 = _ArrayUnique($aUnique3, 0, 1, 0, 1)
_ArrayDisplay($aUnique3, "For NB Filter List")

; Create List for lookups
$sPattern1 = "(.*?)([sS])([0-9][0-9])([eE])([0-9][0-9])(.*+)"
$sPattern2 = "(.*?)(\d{4})(.*+)"
For $n1 = 1 To $aUnique4[0]
    $iErrCode = StringRegExp($aUnique4[$n1], $sPattern1, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique4[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique4[$n1] = StringRegExpReplace($aUnique4[$n1], $sPattern, "\1")
        If @error Then
            $iErr = @error
            $iExt = @extended
            ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
            MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
        EndIf
        $aUnique4[$n1] = StringStripWS($aUnique4[$n1], 3)
    EndIf

    $iErrCode = StringRegExp($aUnique4[$n1], $sPattern2, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique4[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique4[$n1] = StringRegExpReplace($aUnique4[$n1], $sPattern, "\1")
        If @error Then
            $iErr = @error
            $iExt = @extended
            ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
            MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
        EndIf
        $aUnique4[$n1] = StringStripWS($aUnique4[$n1], 3)
    EndIf

    $aUnique4[$n1] = StringReplace($aUnique4[$n1], ".", " ")
Next
$aUnique4 = _ArrayUnique($aUnique4, 0, 1, 0, 1)
_ArrayDisplay($aUnique4, "Setup for Lookup")


Func GetClip()
    ; Retrieve the data stored in the clipboard.
    Local $sData = ClipGet()
    If @error <> 0 Then
        Select
            Case @error = 1
                $sErrMsg = "Clipboard is Empty."
                MsgBox(0, "Error", $sErrMsg)

            Case @error = 2
                $sErrMsg = "Clipboard Contains non-text entry."
                MsgBox(0, "Error", $sErrMsg)

            Case @error = 3 Or @error = 4
                $sErrMsg = "Cannot Access Clipboard"
                MsgBox(0, "Error", $sErrMsg)

            Case Else
                $sErrMsg = "Unknown Clipboard Error"
                MsgBox(0, "Error", $sErrMsg)
        EndSelect
        Exit
    EndIf

    Return $sData
EndFunc   ;==>GetClip

Func ArraySortByLen(ByRef $aArray, $iDescending = 1, $iStart = 0, $iEnd = 0)
    If Not IsArray($aArray) Or UBound($aArray, 0) > 1 Then Return SetError(1, 0, 0) ; Not a 1D array
    If Not IsInt($iStart) Or Not IsInt($iEnd) Then Return SetError(5, 0, 0) ; Parameters need to be integers.

    Local $iBound = UBound($aArray)
    Local $aElementLen[$iBound][2]
    $iBound -= 1

    For $i = 0 To $iBound
        $aElementLen[$i][0] = StringLen($aArray[$i]) ; Get the length of the element
        $aElementLen[$i][1] = $aArray[$i] ; The element to sort
    Next

    _ArraySort($aElementLen, $iDescending, $iStart, $iEnd)
    If @error Then Return SetError(@error, 0, 0) ; See _ArraySort() for error codes 2 to 4.

    For $i = 0 To $iBound
        $aArray[$i] = $aElementLen[$i][1]
    Next
    Return $aArray
EndFunc   ;==>ArraySortByLen

Func ArrayDeleteRows(ByRef $aArray)
    Local $n1
    Local $iDeleteIndex
    Local $aDeleteIndex
    Local $iCnt = 0
    Local $bFlag = False

    For $n1 = 1 To $aArray[0]
        If $aArray[$n1] = "DELETE" Then
            $iDeleteIndex = $iDeleteIndex & $n1 & ","
            $iCnt = $iCnt + 1
            $bFlag = True
        EndIf
    Next
    ; Delete the flagged records using the above index
    If $bFlag = True Then
        If StringRight($iDeleteIndex, 1) = "," Then
            $iDeleteIndex = StringTrimRight($iDeleteIndex, 1)
        EndIf
        If $iCnt = 1 Then
            _ArrayDelete($aArray, $iDeleteIndex)
        EndIf
        If $iCnt > 1 Then
            $aDeleteIndex = StringSplit($iDeleteIndex, ",")
            _ArrayDelete($aArray, $aDeleteIndex)
        EndIf
    EndIf
EndFunc   ;==>ArrayDeleteRows

Func ArrayMarkBlanksforDeletion(ByRef $aArray)
    Local $n1
    Local $sResult
    For $n1 = 1 To $aArray[0]
        $sResult = StringStripWS($aArray[$n1], 8)
        If $sResult = "" Then
            $aArray[$n1] = "Delete"
        EndIf
    Next
EndFunc   ;==>ArrayMarkBlanksforDeletion

Func FileToArray($sFullFileName)
    Local $aArray = FileReadToArray($sFullFileName)
    If @error Then
        MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error)
    Else
        Return $aArray
    EndIf
EndFunc   ;==>FileToArray

 

Share this post


Link to post
Share on other sites
BrewManNH

Approximately how many rows are in the array when you're displaying it?

Also, which one of the _ArrayDisplays is causing the display issue? Is it all of them?

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
OldGuyWalking

Approximately how many rows are in the array when you're displaying it?

Also, which one of the _ArrayDisplays is causing the display issue? Is it all of them?

The number of rows varies. I've tested it with a single row up to around 12,000.  As the script runs it deletes some records from the Array (I use _ArrayDelete) and I use the _ArrayUnique function towards the end which shrinks the list down as well.  The behavior occurs regardless of the size of the array.

If I understand your second question I've only used single dimensioned arrays (1 column x variable number of rows) in this script.  I did just test a 2D array with _ArrayDisplay and the grid blanks on it as well. [I just figured out what you meant, I think.  All of the calls to _ArrayDisplay in the script do the same thing. They will display and then after a short interval the grid will blank out.  I'll scroll through and "refresh" the grid but it continues to blank out after a few seconds. I have another script that has pretty much the same functionality but with a separate set of data and it has the same behavior.

Thanks,

Bill

Edited by OldGuyWalking
Fixed response to question.

Share this post


Link to post
Share on other sites
jchd

I've been plagued by this artifact for long and identified outdated Logitech drivers to be the culprit (in mly case).


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
OldGuyWalking

If you just create an array manually, without interacting with this third party application, does the problem persist?

Yes.  I've included the script below with some test data added.  The only difference in this array versus the one created from the clipboard are the quotes I added around the string and inside the string I had to add double quotes to already quoted text.

#include <MsgBoxConstants.au3>
#include <array.au3>

; Copy TV show list from clipboard.

Dim $sShowlist
Dim $ArrayList[77]
Dim $n1
Dim $n2
Dim $iDeleteIndex
Dim $aDeleteIndex
Dim $bFlag = False
Dim $sSection1
Dim $sPattern
Dim $sJunkText
Dim $aUnique1
Dim $aUnique2
Dim $aUnique3
Dim $sErrMsg
Dim $iErrCode
Dim $iPosStart
Dim $iPosEnd
Dim $sResult
Dim $iErr
Dim $iExt

 $ArrayList[0]=76
 $ArrayList[1]="[259560]-[FULL]-[a.b.stuff@ABCINC]-[ My.Big.Dog.S10E08.720p.WEBRip.x264-WNN ]-[33/42] - ""My.Big.Dog.s10e08.720p.webrip.x264-wnn.rar"" yEnc,Idle/New [34 files,8 pars],1.63 GB,0d:00h:58m,Contributor3,a.b.stuff"
 $ArrayList[2]="[259559]-[FULL]-[a.b.stuff@ABCINC]-[ My.Big.Dog.S10E08.WEBRip.x264-WNN ]-[54/62] - ""My.Big.Dog.s10e08.webrip.x264-wnn.rar"" yEnc,Idle/New [49 files,7 pars],765.2 MB,0d:01h:01m,Contributor1,a.b.stuff"
 $ArrayList[3]="[259558]-[FULL]-[a.b.stuff@ABCINC]-[ My.Weird.Biting.Sibling.S05E47.720p.HDTV.x264-C4TV ]-[30/39] - ""My.Weird.Biting.Sibling.s05e47.720p.hdtv.x264-c4tv.rar"" yEnc,Idle/New [24 files,8 pars],1.11 GB,0d:01h:29m,Contributor3,a.b.stuff"
 $ArrayList[4]="[259557]-[FULL]-[a.b.stuff@ABCINC]-[ My.Weird.Biting.Sibling.S05E47.HDTV.x264-C4TV ]-[19/27] - ""My.Weird.Biting.Sibling.s05e47.hdtv.x264-c4tv.rar"" yEnc,Idle/New [20 files,7 pars],383.8 MB,0d:01h:32m,Contributor2,a.b.stuff"
 $ArrayList[5]="[259554]-[FULL]-[a.b.stuff@ABCINC]-[ Nonexistent.History.S01E01.720p.HDTV.x264-C4TV ]-[28/36] - ""Nonexistent.History.s01e01.720p.hdtv.x264-c4tv.rar"" yEnc,Idle/New [22 files,7 pars],1.01 GB,0d:01h:36m,Contributor1,a.b.stuff"
 $ArrayList[6]="[259555]-[FULL]-[a.b.stuff@ABCINC]-[ Nonexistent.History.S01E01.HDTV.x264-C4TV ]-[25/33] - ""Nonexistent.History.s01e01.hdtv.x264-c4tv.rar"" yEnc,Idle/New [21 files,7 pars],394.4 MB,0d:01h:37m,Contributor5,a.b.stuff"
 $ArrayList[7]="[259547]-[FULL]-[a.b.stuff@ABCINC]-[ My.Sibling.AZ.S16E65.720p.HDTV.x264-C4TV ]-[29/37] - ""My.Sibling.AZ.s16e65.720p.hdtv.x264-c4tv.rar"" yEnc,Idle/New [22 files,7 pars],996.7 MB,0d:02h:30m,Contributor2,a.b.stuff"
 $ArrayList[8]="[259545]-[FULL]-[a.b.stuff@ABCINC]-[ My.Sibling.AZ.S16E65.HDTV.x264-C4TV ]-[24/32] - ""My.Sibling.AZ.s16e65.hdtv.x264-c4tv.rar"" yEnc,Idle/New [18 files,7 pars],327.0 MB,0d:02h:33m,Contributor5,a.b.stuff"
 $ArrayList[9]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E15.DVDRip.INTERNAL.X264-GHOULS ]-[53/61] - ""A.Brief.History.of.An.Island.s01e15.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [41 files,7 pars],632.7 MB,0d:02h:37m,Contributor3,a.b.stuff"
 $ArrayList[10]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E14.DVDRip.INTERNAL.X264-GHOULS ]-[46/53] - ""A.Brief.History.of.An.Island.s01e14.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [34 files,6 pars],510.9 MB,0d:02h:37m,Contributor3,a.b.stuff"
 $ArrayList[11]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E13.DVDRip.INTERNAL.X264-GHOULS ]-[53/61] - ""A.Brief.History.of.An.Island.s01e13.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [41 files,7 pars],632.0 MB,0d:02h:37m,Contributor3,a.b.stuff"
 $ArrayList[12]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E10.DVDRip.INTERNAL.X264-GHOULS ]-[51/59] - ""A.Brief.History.of.An.Island.s01e10.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [39 files,7 pars],596.4 MB,0d:02h:38m,Contributor3,a.b.stuff"
 $ArrayList[13]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E12.DVDRip.INTERNAL.X264-GHOULS ]-[48/55] - ""A.Brief.History.of.An.Island.s01e12.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [35 files,6 pars],522.2 MB,0d:02h:38m,Contributor3,a.b.stuff"
 $ArrayList[14]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E11.DVDRip.INTERNAL.X264-GHOULS ]-[52/60] - ""A.Brief.History.of.An.Island.s01e11.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [39 files,7 pars],593.4 MB,0d:02h:38m,Contributor3,a.b.stuff"
 $ArrayList[15]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E09.DVDRip.INTERNAL.X264-GHOULS ]-[56/64] - ""A.Brief.History.of.An.Island.s01e09.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [43 files,7 pars],668.3 MB,0d:02h:38m,Contributor3,a.b.stuff"
 $ArrayList[16]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E08.DVDRip.INTERNAL.X264-GHOULS ]-[53/61] - ""A.Brief.History.of.An.Island.s01e08.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [40 files,7 pars],611.5 MB,0d:02h:38m,Contributor3,a.b.stuff"
 $ArrayList[17]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E07.DVDRip.INTERNAL.X264-GHOULS ]-[46/53] - ""A.Brief.History.of.An.Island.s01e07.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [34 files,6 pars],519.2 MB,0d:02h:38m,Contributor3,a.b.stuff"
 $ArrayList[18]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E04.DVDRip.INTERNAL.X264-GHOULS ]-[56/64] - ""A.Brief.History.of.An.Island.s01e04.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [43 files,7 pars],661.5 MB,0d:02h:39m,Contributor3,a.b.stuff"
 $ArrayList[19]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E06.DVDRip.INTERNAL.X264-GHOULS ]-[44/51] - ""A.Brief.History.of.An.Island.s01e06.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [32 files,6 pars],481.3 MB,0d:02h:39m,Contributor3,a.b.stuff"
 $ArrayList[20]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E05.DVDRip.INTERNAL.X264-GHOULS ]-[45/52] - ""A.Brief.History.of.An.Island.s01e05.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [34 files,6 pars],510.1 MB,0d:02h:39m,Contributor3,a.b.stuff"
 $ArrayList[21]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E02.DVDRip.INTERNAL.X264-GHOULS ]-[64/72] - ""A.Brief.History.of.An.Island.s01e02.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [51 files,7 pars],795.4 MB,0d:02h:39m,Contributor3,a.b.stuff"
 $ArrayList[22]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E03.DVDRip.INTERNAL.X264-GHOULS ]-[51/59] - ""A.Brief.History.of.An.Island.s01e03.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [39 files,7 pars],603.2 MB,0d:02h:39m,Contributor3,a.b.stuff"
 $ArrayList[23]="[259538]-[FULL]-[a.b.stuff@ABCINC]-[ A.Brief.History.of.An.Island.S01E01.DVDRip.INTERNAL.X264-GHOULS ]-[50/59] - ""A.Brief.History.of.An.Island.s01e01.dvdrip.internal.x264-ghouls.rar"" yEnc,Idle/New [38 files,7 pars],598.7 MB,0d:02h:39m,Contributor3,a.b.stuff"
 $ArrayList[24]="[259526]-[FULL]-[a.b.stuff@ABCINC]-[ Im.an.Experience.S27E08.Blackout.HDTV.x264-W4F ]-[03/29] - ""Im.an.Experience.s27e08.blackout.hdtv.x264-w4f.part01.rar"" yEnc,Idle/New [22 files,7 pars],417.8 MB,0d:05h:33m,Contributor1,a.b.stuff"
 $ArrayList[25]="[259524]-[FULL]-[a.b.stuff@ABCINC]-[ Im.an.Experience.S27E08.Blackout.720p.HDTV.x264-W4F ]-[03/38] - ""Im.an.Experience.s27e08.blackout.720p.hdtv.x264-w4f.part01.rar"" yEnc,Idle/New [30 files,8 pars],1.42 GB,0d:05h:42m,Contributor3,a.b.stuff"
 $ArrayList[26]="[259506]-[FULL]-[a.b.stuff@ABCINC]-[ Why.Not.Tomorrow.S03E06.Kate.Dehnert.PDTV.x264-CBFM ]-[35/43] - ""at.0306.pdtv.x264-cbfm.rar"" yEnc,Idle/New [36 files,7 pars],741.7 MB,0d:07h:07m,Contributor1,a.b.stuff"
 $ArrayList[27]="[259398]-[FULL]-[a.b.stuff@ABCINC]-[ Jumping.Long.S02E14.WEBRip.x264-ANiHLS ]-[09/16] - ""anihls-babste.s02e14.webrip.rar"" yEnc,Idle/New [10 files,6 pars],107.9 MB,0d:15h:28m,Contributor2,a.b.stuff"
 $ArrayList[28]="[259397]-[FULL]-[a.b.stuff@ABCINC]-[ Jumping.Long.S02E14.720p.WEBRip.x264-ANiHLS ]-[10/18] - ""anihls-babste.s02e14.720p.webrip.rar"" yEnc,Idle/New [11 files,7 pars],390.2 MB,0d:15h:28m,Contributor4,a.b.stuff"
 $ArrayList[29]="[259389]-[FULL]-[a.b.stuff@ABCINC]-[ Jumping.Long.S02E14.1080p.WEBRip.x264-ANiHLS ]-[14/22] - ""anihls-babste.s02e14.1080p.webrip.rar"" yEnc,Idle/New [15 files,7 pars],650.1 MB,0d:16h:38m,Contributor2,a.b.stuff"
 $ArrayList[30]="[259388]-[FULL]-[a.b.stuff@ABCINC]-[ Jumping.Long.S02E13.WEBRip.x264-ANiHLS ]-[09/16] - ""anihls-babste.s02e13.webrip.rar"" yEnc,Idle/New [10 files,6 pars],107.9 MB,0d:16h:39m,Contributor1,a.b.stuff"
 $ArrayList[31]="[259384]-[FULL]-[a.b.stuff@ABCINC]-[ Jumping.Long.S02E13.1080p.WEBRip.x264-ANiHLS ]-[22/30] - ""anihls-babste.s02e13.1080p.webrip.rar"" yEnc,Idle/New [15 files,7 pars],650.1 MB,0d:16h:52m,Contributor3,a.b.stuff"
 $ArrayList[32]="[259382]-[FULL]-[a.b.stuff@ABCINC]-[ Jumping.Long.S02E13.720p.WEBRip.x264-ANiHLS ]-[17/25] - ""anihls-babste.s02e13.720p.webrip.rar"" yEnc,Idle/New [11 files,7 pars],390.2 MB,0d:16h:53m,Contributor2,a.b.stuff"
 $ArrayList[33]="[259372]-[FULL]-[a.b.stuff@ABCINC]-[ My.Weird.Biting.Sibling.S05E46.720p.HDTV.x264-C4TV ]-[35/44] - ""My.Weird.Biting.Sibling.s05e46.720p.hdtv.x264-c4tv.rar"" yEnc,Idle/New [28 files,8 pars],1.34 GB,0d:19h:44m,Contributor3,a.b.stuff"
 $ArrayList[34]="[259371]-[FULL]-[a.b.stuff@ABCINC]-[ My.Weird.Biting.Sibling.S05E46.HDTV.x264-C4TV ]-[31/39] - ""My.Weird.Biting.Sibling.s05e46.hdtv.x264-c4tv.rar"" yEnc,Idle/New [26 files,7 pars],519.2 MB,0d:19h:48m,Contributor3,a.b.stuff"
 $ArrayList[35]="[259370]-[FULL]-[a.b.stuff@ABCINC]-[ My.Sibling.AZ.S16E64.720p.HDTV.x264-C4TV ]-[28/36] - ""My.Sibling.AZ.s16e64.720p.hdtv.x264-c4tv.rar"" yEnc,Idle/New [21 files,7 pars],987.7 MB,0d:19h:49m,Contributor5,a.b.stuff"
 $ArrayList[36]="[259369]-[FULL]-[a.b.stuff@ABCINC]-[ My.Sibling.AZ.S16E64.HDTV.x264-C4TV ]-[23/31] - ""My.Sibling.AZ.s16e64.hdtv.x264-c4tv.rar"" yEnc,Idle/New [18 files,7 pars],333.7 MB,0d:19h:52m,Contributor5,a.b.stuff"
 $ArrayList[37]="[259362]-[FULL]-[a.b.stuff@ABCINC]-[ Fubarred.S02E12.HDTV.x264-CRiMSON ]-[28/36] - ""Fubarred.s02e12.hdtv.x264-crimson.rar"" yEnc,Idle/New [23 files,7 pars],325.4 MB,0d:21h:24m,Contributor5,a.b.stuff"
 $ArrayList[38]="[259331]-[FULL]-[a.b.stuff@ABCINC]-[ Mine.Alternate.Universe.S11E14.prickly.heat.HDTV.x264-CRiMSON ]-[33/41] - ""Mine.Alternate.Universe.s11e14.prickly.heat.hdtv.x264-crimson.rar"" yEnc,Idle/New [27 files,7 pars],392.8 MB,0d:23h:51m,Contributor4,a.b.stuff"
 $ArrayList[39]="[259330]-[FULL]-[a.b.stuff@ABCINC]-[ Wives.of.Players.S04E01.HDTV.x264-CRiMSON ]-[29/37] - ""Wives.of.Players.s04e01.hdtv.x264-crimson.rar"" yEnc,Idle/New [24 files,7 pars],348.9 MB,0d:23h:52m,Contributor4,a.b.stuff"
 $ArrayList[40]="[259288]-[FULL]-[a.b.stuff@ABCINC]-[ A.Big.Moat.S01E06.DVDRip.X264-GHOULS ]-[37/45] - ""A.Big.Moat.s01e06.dvdrip.x264-ghouls.rar"" yEnc,Idle/New [28 files,7 pars],415.5 MB,1d:06h:30m,Contributor4,a.b.stuff"
 $ArrayList[41]="[259288]-[FULL]-[a.b.stuff@ABCINC]-[ A.Big.Moat.S01E05.DVDRip.X264-GHOULS ]-[39/46] - ""A.Big.Moat.s01e05.dvdrip.x264-ghouls.rar"" yEnc,Idle/New [31 files,6 pars],464.7 MB,1d:06h:30m,Contributor4,a.b.stuff"
 $ArrayList[42]="[259288]-[FULL]-[a.b.stuff@ABCINC]-[ A.Big.Moat.S01E04.DVDRip.X264-GHOULS ]-[41/48] - ""A.Big.Moat.s01e04.dvdrip.x264-ghouls.rar"" yEnc,Idle/New [33 files,6 pars],495.8 MB,1d:06h:30m,Contributor4,a.b.stuff"
 $ArrayList[43]="[259288]-[FULL]-[a.b.stuff@ABCINC]-[ A.Big.Moat.S01E03.DVDRip.X264-GHOULS ]-[40/47] - ""A.Big.Moat.s01e03.dvdrip.x264-ghouls.rar"" yEnc,Idle/New [31 files,6 pars],460.2 MB,1d:06h:30m,Contributor4,a.b.stuff"
 $ArrayList[44]="[259288]-[FULL]-[a.b.stuff@ABCINC]-[ A.Big.Moat.S01E02.DVDRip.X264-GHOULS ]-[38/46] - ""A.Big.Moat.s01e02.dvdrip.x264-ghouls.rar"" yEnc,Idle/New [30 files,7 pars],439.0 MB,1d:06h:30m,Contributor4,a.b.stuff"
 $ArrayList[45]="[259288]-[FULL]-[a.b.stuff@ABCINC]-[ A.Big.Moat.S01E01.DVDRip.X264-GHOULS ]-[41/48] - ""A.Big.Moat.s01e01.dvdrip-ghouls.rar"" yEnc,Idle/New [33 files,6 pars],501.8 MB,1d:06h:31m,Contributor4,a.b.stuff"
 $ArrayList[46]="[259271]-[FULL]-[a.b.stuff@ABCINC]-[ Jumping.Through.Hoops.S07E07.REPACK.720p.HDTV.x264-W4F ]-[03/69] - ""Jumping.Through.Hoops.s07e07.repack.720p.hdtv.x264-w4f.part01.rar"" yEnc,Idle/New [61 files,8 pars],3.10 GB,1d:11h:15m,Contributor3,a.b.stuff"
 $ArrayList[47]="[259270]-[FULL]-[a.b.stuff@ABCINC]-[ Barbells.Are.Us.S05E23.720p.HDTV.x264-SYS ]-[33/42] - ""Barbells.Are.Us.523.720p.hdtv.x264-sys.rar"" yEnc,Idle/New [26 files,8 pars],1.20 GB,1d:11h:19m,Contributor5,a.b.stuff"
 $ArrayList[48]="[259267]-[FULL]-[a.b.stuff@ABCINC]-[ Barbells.Are.Us.S05E23.HDTV.x264-SYS ]-[30/38] - ""Barbells.Are.Us.523.hdtv.x264-sys.rar"" yEnc,Idle/New [25 files,7 pars],370.1 MB,1d:11h:21m,Contributor3,a.b.stuff"
 $ArrayList[49]="[259244]-[FULL]-[a.b.stuff@ABCINC]-[ Secrets.Of.The.Caves.S01E12.720p.HDTV.x264-NORiTE ]-[22/30] - ""Secrets.Of.The.Caves.s01e12.720p.hdtv-norite.rar"" yEnc,Idle/New [16 files,7 pars],700.9 MB,1d:15h:05m,Contributor4,a.b.stuff"
 $ArrayList[50]="[259243]-[FULL]-[a.b.stuff@ABCINC]-[ Secrets.Of.The.Caves.S01E12.HDTV.x264-NORiTE ]-[13/20] - ""Secrets.Of.The.Caves.s01e12.hdtv-norite.rar"" yEnc,Idle/New [14 files,6 pars],249.0 MB,1d:15h:08m,Contributor5,a.b.stuff"
 $ArrayList[51]="[259227]-[FULL]-[a.b.stuff@ABCINC]-[ The.Foodie.In.Me.S02E03.Atlanta.720p.HDTV.x264-DHD ]-[13/21] - ""The.Foodie.In.Me.s02e03.720p-dhd.rar"" yEnc,Idle/New [14 files,7 pars],561.6 MB,1d:19h:37m,Contributor2,a.b.stuff"
 $ArrayList[52]="[259223]-[FULL]-[a.b.stuff@ABCINC]-[ Jumping.Through.Hoops.S07E07.REPACK.HDTV.x264-W4F ]-[03/59] - ""Jumping.Through.Hoops.s07e07.repack.hdtv.x264-w4f.part01.rar"" yEnc,Idle/New [51 files,8 pars],1.05 GB,1d:20h:14m,Contributor5,a.b.stuff"
 $ArrayList[53]="[259198]-[FULL]-[a.b.stuff@ABCINC]-[ My.Weird.Biting.Sibling.S05E45.720p.HDTV.x264-C4TV ]-[40/49] - ""My.Weird.Biting.Sibling.s05e45.720p.hdtv.x264-c4tv.rar"" yEnc,Idle/New [33 files,8 pars],1.59 GB,1d:23h:56m,Contributor2,a.b.stuff"
 $ArrayList[54]="[259196]-[FULL]-[a.b.stuff@ABCINC]-[ My.Weird.Biting.Sibling.S05E45.HDTV.x264-C4TV ]-[35/43] - ""My.Weird.Biting.Sibling.s05e45.hdtv.x264-c4tv.rar"" yEnc,Idle/New [29 files,7 pars],584.3 MB,2d:00h:03m,Contributor5,a.b.stuff"
 $ArrayList[55]="[259166]-[FULL]-[a.b.stuff@ABCINC]-[ My.Sibling.AZ.S16E63.720p.HDTV.x264-C4TV ]-[32/41] - ""My.Sibling.AZ.s16e63.720p.hdtv.x264-c4tv.rar"" yEnc,Idle/New [24 files,8 pars],1.10 GB,2d:03h:38m,Contributor4,a.b.stuff"
 $ArrayList[56]="[259165]-[FULL]-[a.b.stuff@ABCINC]-[ My.Sibling.AZ.S16E63.HDTV.x264-C4TV ]-[25/33] - ""My.Sibling.AZ.s16e63.hdtv.x264-c4tv.rar"" yEnc,Idle/New [19 files,7 pars],362.6 MB,2d:03h:43m,Contributor5,a.b.stuff"
 $ArrayList[57]="[259119]-[FULL]-[a.b.stuff@ABCINC]-[ 2100 Hours.S01E07.720p.HDTV.x264-BATV ]-[26/43] - ""2100 Hours.s01e07.720p.hdtv.x264-batv.rar"" yEnc,Idle/New [27 files,8 pars],1.28 GB,2d:08h:45m,Contributor2,a.b.stuff"
 $ArrayList[58]="[259118]-[FULL]-[a.b.stuff@ABCINC]-[ 2100 Hours.S01E07.HDTV.x264-BATV ]-[23/31] - ""2100 Hours.s01e07.hdtv.x264-batv.rar"" yEnc,Idle/New [24 files,7 pars],343.5 MB,2d:09h:01m,Contributor3,a.b.stuff"
 $ArrayList[59]="[259117]-[FULL]-[a.b.stuff@ABCINC]-[ 2100 Hours.S01E06.720p.HDTV.x264-BATV ]-[20/36] - ""2100 Hours.s01e06.720p.hdtv.x264-batv.rar"" yEnc,Idle/New [21 files,7 pars],986.9 MB,2d:09h:18m,Contributor4,a.b.stuff"
 $ArrayList[60]="[259116]-[FULL]-[a.b.stuff@ABCINC]-[ 2100 Hours.S01E06.HDTV.x264-BATV ]-[18/31] - ""2100 Hours.s01e06.hdtv.x264-batv.rar"" yEnc,Idle/New [19 files,6 pars],262.6 MB,2d:09h:33m,Contributor1,a.b.stuff"
 $ArrayList[61]="[259115]-[FULL]-[a.b.stuff@ABCINC]-[ 2100 Hours.S01E05.720p.HDTV.x264-BATV ]-[23/32] - ""2100 Hours.s01e05.720p.hdtv.x264-batv.rar"" yEnc,Idle/New [24 files,8 pars],1.13 GB,2d:09h:40m,Contributor3,a.b.stuff"
 $ArrayList[62]="[259114]-[FULL]-[a.b.stuff@ABCINC]-[ 2100 Hours.S01E05.HDTV.x264-BATV ]-[21/35] - ""2100 Hours.s01e05.hdtv.x264-batv.rar"" yEnc,Idle/New [22 files,7 pars],317.8 MB,2d:10h:04m,Contributor2,a.b.stuff"
 $ArrayList[63]="[259110]-[FULL]-[a.b.stuff@ABCINC]-[ Hungry.Dolphins.S11E03.720p.HDTV.x264-MiNDTHEGAP ]-[14/22] - ""Hungry.Dolphins.s11e03.720p.hdtv.x264-mtg.rar"" yEnc,Idle/New [9 files,7 pars],287.6 MB,2d:11h:16m,Contributor5,a.b.stuff"
 $ArrayList[64]="[259083]-[FULL]-[a.b.stuff@ABCINC]-[ 40.Days.and.32.Afternoons.S07E15.iNTERNAL.720p.HDTV.x264-CBFM ]-[13/21] - ""40.Days.and.32.Afternoons.s07e15.internal.720p.hdtv.x264-cbfm.rar"" yEnc,Idle/New [14 files,7 pars],589.7 MB,2d:13h:44m,Contributor5,a.b.stuff"
 $ArrayList[65]="[259064]-[FULL]-[a.b.stuff@ABCINC]-[ My.Other.Sibling.NE.S17E09.HDTV.x264-CBFM ]-[29/37] - ""My.Other.Sibling.NE.s17e09.hdtv.x264-cbfm.rar"" yEnc,Idle/New [30 files,7 pars],450.2 MB,2d:19h:55m,Contributor4,a.b.stuff"
 $ArrayList[66]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E10.DVDRip.X264-OSiTV ]-[30/38] - ""The.Gnosher.210.dvdrip.x264-ositv.rar"" yEnc,Idle/New [21 files,7 pars],295.2 MB,2d:20h:19m,Contributor4,a.b.stuff"
 $ArrayList[67]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E09.DVDRip.X264-OSiTV ]-[27/35] - ""The.Gnosher.209.dvdrip.x264-ositv.rar"" yEnc,Idle/New [19 files,7 pars],268.7 MB,2d:20h:19m,Contributor4,a.b.stuff"
 $ArrayList[68]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E08.DVDRip.X264-OSiTV ]-[31/39] - ""The.Gnosher.208.dvdrip.x264-ositv.rar"" yEnc,Idle/New [22 files,7 pars],312.6 MB,2d:20h:19m,Contributor4,a.b.stuff"
 $ArrayList[69]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E07.DVDRip.X264-OSiTV ]-[28/36] - ""The.Gnosher.207.dvdrip.x264-ositv.rar"" yEnc,Idle/New [20 files,7 pars],283.1 MB,2d:20h:19m,Contributor4,a.b.stuff"
 $ArrayList[70]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E06.DVDRip.X264-OSiTV ]-[33/41] - ""The.Gnosher.206.dvdrip.x264-ositv.rar"" yEnc,Idle/New [23 files,7 pars],333.0 MB,2d:20h:19m,Contributor4,a.b.stuff"
 $ArrayList[71]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E05.DVDRip.X264-OSiTV ]-[27/35] - ""The.Gnosher.205.dvdrip.x264-ositv.rar"" yEnc,Idle/New [19 files,7 pars],267.9 MB,2d:20h:19m,Contributor4,a.b.stuff"
 $ArrayList[72]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E04.DVDRip.X264-OSiTV ]-[29/37] - ""The.Gnosher.204.dvdrip.x264-ositv.rar"" yEnc,Idle/New [21 files,7 pars],291.4 MB,2d:20h:19m,Contributor4,a.b.stuff"
 $ArrayList[73]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E01.DVDRip.X264-OSiTV ]-[35/43] - ""The.Gnosher.201.dvdrip.x264-ositv.rar"" yEnc,Idle/New [22 files,7 pars],319.3 MB,2d:20h:20m,Contributor4,a.b.stuff"
 $ArrayList[74]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E02.DVDRip.X264-OSiTV ]-[29/37] - ""The.Gnosher.202.dvdrip.x264-ositv.rar"" yEnc,Idle/New [20 files,7 pars],279.3 MB,2d:20h:20m,Contributor4,a.b.stuff"
 $ArrayList[75]="[259057]-[FULL]-[a.b.stuff@ABCINC]-[ The.Gnosher.S02E03.DVDRip.X264-OSiTV ]-[33/41] - ""The.Gnosher.203.dvdrip.x264-ositv.rar"" yEnc,Idle/New [24 files,7 pars],346.6 MB,2d:20h:20m,Contributor4,a.b.stuff"
 $ArrayList[76]="[259053]-[FULL]-[a.b.stuff@ABCINC]-[ Mindless.2015.S01E04.INTERNAL.HDTV.x264-BATV ]-[21/29] - ""Mindless.2015.s01e04.internal.hdtv.x264-batv.rar"" yEnc,Idle/Old [22 files,7 pars],308.8 MB,2d:20h:43m,Contributor4,a.b.stuff"


#comments-start
    Error Codes for ClipGet
    1 = if clipboard is empty
    2 = if contains a non-text entry.
    3 or 4 = if cannot access the clipboard.
#comments-end

If Not ISArray($ArrayList) Then
    $ArrayList = StringSplit(GetClip(), @CR)
EndIf

If $ArrayList[0] < 1 Then
    $sErrMsg = "Not Enough Records"
    MsgBox(0, "Error", $sErrMsg)
    Exit
EndIf

; MsgBox(0, "Records", "Record Count = " & $ArrayList[0])
; _ArrayDisplay($ArrayList, "Unchanged List")

; Delete Leading Whitespace in array
For $n1 = 1 To $ArrayList[0]
    $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 1)
Next
; _ArrayDisplay($ArrayList, "Leading Whitespace cleared")

; Delete unneeded records
For $n1 = 1 To $ArrayList[0]
    $sPattern = "^RE:"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "^REQ:"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "(.+)(sample\-|\.sample\.)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
    $sPattern = "(.+)(proof\-|\.proof\.)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = "DELETE"
        ContinueLoop
    EndIf
Next
ArrayMarkBlanksforDeletion($ArrayList)
ArrayDeleteRows($ArrayList)
$ArrayList[0] = UBound($ArrayList) - 1
; _ArrayDisplay($ArrayList, "First cleanup")

For $n1 = 1 To $ArrayList[0]
    ; $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.d{4}\.[Ss][0-9][0-9][eE][0-9][0-9]\.|\.[Ss][0-9][0-9][eE][0-9][0-9]\.|\.\d{4}\.|\.\d\d\.|\.720p|\.1080p|\.HDTV|\.PDTV|\.DVD|S[0-9][0-9]\.)(.+)"

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.d{4}\.[Ss][0-9][0-9][eE][0-9][0-9]\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.[Ss][0-9][0-9][eE][0-9][0-9]\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.\d{4}\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.\d{2}\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.720p|\.1080p|\.HDTV|\.PDTV|\.DVD\.|x264)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2")
        ContinueLoop
    EndIf

    $sPattern = "(.+)(\s[A-Za-z0-9].*?)(\.S[0-9][0-9]\.)(.+)"
    $iErrCode = StringRegExp($ArrayList[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $ArrayList[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $ArrayList[$n1] = StringRegExpReplace($ArrayList[$n1], $sPattern, "\2\3")
        ContinueLoop
    EndIf

Next
; _ArrayDisplay($ArrayList, "First List")

; Remove brackets, periods, and underscores from string and trim whitespace from front and back of String.
For $n1 = 1 To $ArrayList[0]

    $ArrayList[$n1] = StringReplace($ArrayList[$n1], "[", "", 1)
    $ArrayList[$n1] = StringReplace($ArrayList[$n1], " ]", "", 1)
    $ArrayList[$n1] = StringReplace($ArrayList[$n1], ".", " ")
    $ArrayList[$n1] = StringReplace($ArrayList[$n1], "_", " ")
    $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 3)
    If StringRight($ArrayList[$n1], 1) = "-" Then
        $ArrayList[$n1] = StringTrimRight($ArrayList[$n1], 1)
        $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 3)
    EndIf

Next
; _ArrayDisplay($ArrayList, "Cleanup #1")

; Remove non-title related text
$sJunkText = FileToArray(@ScriptDir & "\JunkData.txt")
;_ArrayDisplay($sJunkText)
If IsArray($sJunkText) Then
    $sJunkText = ArraySortByLen($sJunkText, 1, 0, UBound($sJunkText))
    ;_ArrayDisplay($sJunkText)
    For $n2 = 0 To UBound($sJunkText) - 1
        For $n1 = 1 To $ArrayList[0]
            $ArrayList[$n1] = StringReplace($ArrayList[$n1], " " & $sJunkText[$n2], "", Default, 1)
            $ArrayList[$n1] = StringStripWS($ArrayList[$n1], 3)
        Next
    Next
EndIf
; _ArrayDisplay($ArrayList, "Cleanup #2")

; Sort the list.
_ArraySort($ArrayList, Default, 1)
_ArrayDisplay($ArrayList, "Sorted")

; Remove duplicates from the list.
$aUnique1 = _ArrayUnique($ArrayList, 0, 1, 0, 1)
; _ArrayDisplay($aUnique1, "DeDuplicated")

$aUnique2 = $aUnique1
; Summary List by Title, Season, Episode
$sPattern = "(.*?)([sS])([0-9][0-9])([eE])([0-9][0-9])(.*+)"
For $n1 = 1 To $aUnique2[0]
    $iErrCode = StringRegExp($aUnique2[$n1], "(.*?)([sS])([0-9][0-9])([eE])([0-9][0-9])(.*?)", 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique2[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique2[$n1] = StringRegExpReplace($aUnique2[$n1], $sPattern, "\1- \3x\5 - \6")
        $aUnique2[$n1] = StringStripWS($aUnique2[$n1], 3)
        If StringRight($aUnique2[$n1], 1) = "-" Then
            $aUnique2[$n1] = StringTrimRight($aUnique2[$n1], 1)
            $aUnique2[$n1] = StringStripWS($aUnique2[$n1], 3)
        EndIf
    EndIf
    If @error Then
        $iErr = @error
        $iExt = @extended
        ; ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
        MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
    EndIf
Next
_ArrayDisplay($aUnique2, "Unduplicated List with Season, Episode, and title (if available)")

$aUnique3 = $aUnique1
; Remove yyyy.mm.dd entries
$sPattern = "(.*?)(\d{4}(\s|\.)\d{2}(\s|\.)\d{2})(.*+)"
For $n1 = 1 To $aUnique3[0]
    $iErrCode = StringRegExp($aUnique3[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique2[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique3[$n1] = StringRegExpReplace($aUnique3[$n1], $sPattern, "\1")
        If @error Then
            $iErr = @error
            $iExt = @extended
            ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
            MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
        EndIf
        $aUnique3[$n1] = StringStripWS($aUnique3[$n1], 3)
    EndIf
Next
; _ArrayDisplay($aUnique3, "Strip yyyy.dd.mm from entries")

$aUnique4 = $aUnique3

; Create List for NB Filter
$sPattern = "(.*?)([sS])([0-9][0-9])([eE])([0-9][0-9])(.*+)"
For $n1 = 1 To $aUnique3[0]
    $iErrCode = StringRegExp($aUnique3[$n1], $sPattern, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique2[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique3[$n1] = StringRegExpReplace($aUnique3[$n1], $sPattern, "\1")
        If @error Then
            $iErr = @error
            $iExt = @extended
            ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
            MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
        EndIf
        $aUnique3[$n1] = StringStripWS($aUnique3[$n1], 3)
        $aUnique3[$n1] = $aUnique3[$n1] & ".+s[0-9][0-9]"
    EndIf
    $aUnique3[$n1] = StringReplace($aUnique3[$n1], " ", ".")
Next
; _ArrayDisplay($aUnique3, "Setup for NB filter")

; Remove duplicates from the NB filter list.
$aUnique3 = _ArrayUnique($aUnique3, 0, 1, 0, 1)
_ArrayDisplay($aUnique3, "For NB Filter List")

; Create List for lookups
$sPattern1 = "(.*?)([sS])([0-9][0-9])([eE])([0-9][0-9])(.*+)"
$sPattern2 = "(.*?)(\d{4})(.*+)"
For $n1 = 1 To $aUnique4[0]
    $iErrCode = StringRegExp($aUnique4[$n1], $sPattern1, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique4[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique4[$n1] = StringRegExpReplace($aUnique4[$n1], $sPattern, "\1")
        If @error Then
            $iErr = @error
            $iExt = @extended
            ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
            MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
        EndIf
        $aUnique4[$n1] = StringStripWS($aUnique4[$n1], 3)
    EndIf

    $iErrCode = StringRegExp($aUnique4[$n1], $sPattern2, 0)
    ; ConsoleWrite("Error Code: " & $iErrCode & " String = " & $aUnique4[$n1] & @CRLF)
    If $iErrCode = 1 Then
        $aUnique4[$n1] = StringRegExpReplace($aUnique4[$n1], $sPattern, "\1")
        If @error Then
            $iErr = @error
            $iExt = @extended
            ConsoleWrite("@error = " & $iErr & ", @extended = " & $iExt & @CRLF)
            MsgBox(0, "StringRegExpReplace error", "@error = " & $iErr & ", @extended = " & $iExt & @CRLF & "Pattern: " & $sPattern)
        EndIf
        $aUnique4[$n1] = StringStripWS($aUnique4[$n1], 3)
    EndIf

    $aUnique4[$n1] = StringReplace($aUnique4[$n1], ".", " ")
Next
$aUnique4 = _ArrayUnique($aUnique4, 0, 1, 0, 1)
_ArrayDisplay($aUnique4, "Setup for Lookup")


Func GetClip()
    ; Retrieve the data stored in the clipboard.
    Local $sData = ClipGet()
    If @error <> 0 Then
        Select
            Case @error = 1
                $sErrMsg = "Clipboard is Empty."
                MsgBox(0, "Error", $sErrMsg)

            Case @error = 2
                $sErrMsg = "Clipboard Contains non-text entry."
                MsgBox(0, "Error", $sErrMsg)

            Case @error = 3 Or @error = 4
                $sErrMsg = "Cannot Access Clipboard"
                MsgBox(0, "Error", $sErrMsg)

            Case Else
                $sErrMsg = "Unknown Clipboard Error"
                MsgBox(0, "Error", $sErrMsg)
        EndSelect
        Exit
    EndIf

    Return $sData
EndFunc   ;==>GetClip

Func ArraySortByLen(ByRef $aArray, $iDescending = 1, $iStart = 0, $iEnd = 0)
    If Not IsArray($aArray) Or UBound($aArray, 0) > 1 Then Return SetError(1, 0, 0) ; Not a 1D array
    If Not IsInt($iStart) Or Not IsInt($iEnd) Then Return SetError(5, 0, 0) ; Parameters need to be integers.

    Local $iBound = UBound($aArray)
    Local $aElementLen[$iBound][2]
    $iBound -= 1

    For $i = 0 To $iBound
        $aElementLen[$i][0] = StringLen($aArray[$i]) ; Get the length of the element
        $aElementLen[$i][1] = $aArray[$i] ; The element to sort
    Next

    _ArraySort($aElementLen, $iDescending, $iStart, $iEnd)
    If @error Then Return SetError(@error, 0, 0) ; See _ArraySort() for error codes 2 to 4.

    For $i = 0 To $iBound
        $aArray[$i] = $aElementLen[$i][1]
    Next
    Return $aArray
EndFunc   ;==>ArraySortByLen

Func ArrayDeleteRows(ByRef $aArray)
    Local $n1
    Local $iDeleteIndex
    Local $aDeleteIndex
    Local $iCnt = 0
    Local $bFlag = False

    For $n1 = 1 To $aArray[0]
        If $aArray[$n1] = "DELETE" Then
            $iDeleteIndex = $iDeleteIndex & $n1 & ","
            $iCnt = $iCnt + 1
            $bFlag = True
        EndIf
    Next
    ; Delete the flagged records using the above index
    If $bFlag = True Then
        If StringRight($iDeleteIndex, 1) = "," Then
            $iDeleteIndex = StringTrimRight($iDeleteIndex, 1)
        EndIf
        If $iCnt = 1 Then
            _ArrayDelete($aArray, $iDeleteIndex)
        EndIf
        If $iCnt > 1 Then
            $aDeleteIndex = StringSplit($iDeleteIndex, ",")
            _ArrayDelete($aArray, $aDeleteIndex)
        EndIf
    EndIf
EndFunc   ;==>ArrayDeleteRows

Func ArrayMarkBlanksforDeletion(ByRef $aArray)
    Local $n1
    Local $sResult
    For $n1 = 1 To $aArray[0]
        $sResult = StringStripWS($aArray[$n1], 8)
        If $sResult = "" Then
            $aArray[$n1] = "Delete"
        EndIf
    Next
EndFunc   ;==>ArrayMarkBlanksforDeletion

Func FileToArray($sFullFileName)
    Local $aArray = FileReadToArray($sFullFileName)
    If @error Then
        MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error)
    Else
        Return $aArray
    EndIf
EndFunc   ;==>FileToArray

 

 

Share this post


Link to post
Share on other sites
OldGuyWalking

I've been plagued by this artifact for long and identified outdated Logitech drivers to be the culprit (in mly case).

I'll check it out as soon as I can get hold of a wired keyboard and mouse.  i'd had problems with Logitech SetPoint software a few years back until I'd upgraded to their 6.x version. I use their Unifying tool and the drivers are up to date (Subscription to Driver Detective). Thanks for the suggestion.

Share this post


Link to post
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

×