Sign in to follow this  
Followers 0
zackrspv

Array to Dynamic Split

12 posts in this topic

Okay, so i have wracked my brain on this one.

Let's say i have an array:

$data[0] = "This"
$data[1] = "is a"
$data[2] = "test of the"
$data[3] = "emergency broadcasting system today"
$data[4] = "and here is"
$data[5] = "the reason"
$data[6] = "for"
$data[7] = "my call"
$data[8] = "back to you"
$data[9] = "if that is okay."

Now, let's say that I want to split each and every single element using a delimiter; well, that's easy:

$string = _ArrayToString($data, "|")

But, of course, that only returns a string, for me that would look something like this:

This|is a|test of the|emergency broadcasting system today|and here is|the reason|for|my call|back to you|if that is okay

So, i have split it off to a string, and now i can do some array searches against a master array to find out if any of those search terms appear exactly as they are in the string. For example, i can search for "this", or "is a" or "test of the" against a master array to see if those words appear anywhere in the master array and then do my checks therein.

Problem with that, is that my master array doesn't have ALL of the permutations of the word jumble of "this" or "is a" or "test of the", so if my master array has "Brock is a", it's not going to return the result I want. In fact, it'll skip the result and say it's not found. _ArrayFindAll, _ArraySearch don't do that level of searching. So, instead, I need to split apart this search string into individual words, while still keeping the primary search term intact so that I can reference it when a result is found. So, i need to create an array that looks like the following:

$split[0] = "this   "...............[1] = "This"
$split[1] = "is "...............[1] = "is a"
$split[2] = "a  "...............[1] = "s a"
$split[3] = "test   "...............[1] = "test of the"
$split[4] = "of "...............[1] = "test of the"
$split[5] = "the    "...............[1] = "test of the"
$split[6] = "emergency".....[1] = "emergency broadcasting system today"
$split[7] = "broadcasting"...[1] = "emergency broadcasting system today"
$split[8] = "system"...........[1] = "emergency broadcasting system today"
$split[9] = "today".............[1] = "emergency broadcasting system today"
$split[10] = "and"..............[1] = "and here is"
$split[11] = "here".............[1] = "and here is"
$split[12] = "is".................[1] = "and here is"
$split[13] = "the   "...............[1] = "the reason"
$split[14] = "reason"..........[1] = "the reason"
$split[15] = "for   "...............[1] = "for"
$split[16] = "my    "...............[1] = "my call"
$split[17] = "call"...............[1] = "my call"
$split[18] = "back".............[1] = "back to you"
$split[19] = "to"   ................[1] = "back to you"
$split[20] = "you"...............[1] = "back to you"
$split[21] = "if"..................[1] = "if that is okay."
$split[22] = "that"..............[1] = "if that is okay."
$split[23] = "is"..................[1] = "if that is okay."
$split[24] = "okay"..............[1] = "if that is okay."

Now, I can search using the first dimmension, against the master array, and if the array finds a match, it returns the value in the 2nd dimension as the result, thus allowing me to return what I want to see, be it partial, inline, shifted, whatever results from the master array. *sighs*

But, question is how to create that array :/

Now, of course, it'd be awesome if i could just figure out a way to search my master array for values on the search array without having to split them all apart into individualized words. This way, for example:

Search Term: "Avast Antivirus"

Returns Results for: "Avast Mail Scanner", "Avast Web Scanner", "Avast Link Scanner", "Avast Antivirus", "Avast!", "avast"

Given that the master array only has the term "Avast" in it's definition. The 'mail scanner, web scanner, link scanner, antivirus, avast!' all comes form the search term. So, i want to search the master array for the search term, compare it against a master list, and if it finds the word in the master list, returns the search result, so that it can display relevant matches from the same general define on the master array.

Think of it like creating a super massive list of known gaming applications (omg that's a huge list), and this list is sorted, but setup such a way that "Microsoft Flight Simulator 2005" and "microsoft flight simulator 2007" would actually be as only one element in the master list: "Microsoft Flight Simulator". This way, when the search term "Microsoft flight simulator 2005" is thrown against the master list, it does indeed find the "microsoft flight simulator", but returns the search result as the one found, instead of the result in the master list. It's more of a confirmation thing, hey, yes, the game exists, it's in the list, now return it so that we can see it.

Any idea how this can be accomplished? The whole premise of this particular type of process would be to search all installed programs, and services running on the machine, and return a list of applications based on category. The category would be what gets searched based on the master list. Like, for example, return all installed/running Office Suites, or all installed/running Web Design suites on the machine.

Example

This is what I already have, somewhat:

#include <Array.au3>
Const $NODE = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
Local $i = 1
Dim $data[999]
$Programs = ""
$j = ""
$split = ""
BuildArray()
ReadReg()
Compare()

Func ReadReg()
    While 1
        $var = RegEnumKey($NODE, $i)
        If @error <> 0 Then ExitLoop
        $data[$i] = $var
        $i += 1
    WEnd
EndFunc  ;==>ReadReg

Func Compare()
        $string = _ArrayToString($data, "|")
        $split = StringSplit($string, "|", 0)
        Compare2()
EndFunc  ;==>Compare

Func Compare2()
    For $j = 0 To UBound($split) - 1
        If $split[$j] = "" OR $split[$j] = "1" Then
        Else
            $string2 = $split[$j]
            $string2 = StringReplace($string2, "!", "")
            $string2 = StringReplace($string2, "@", "")
            $string2 = StringReplace($string2, "#", "")
            $string2 = StringReplace($string2, "$", "")
            $string2 = StringReplace($string2, "%", "")
            $string2 = StringReplace($string2, "&", "")
            $string2 = StringReplace($string2, "*", "")
            $string2 = StringReplace($string2, "(", "")
            $string2 = StringReplace($string2, ")", "")
            $string2 = StringReplace($string2, "-", "")
            $string2 = StringReplace($string2, "_", "")
            $string2 = StringReplace($string2, "=", "")
            $string2 = StringReplace($string2, "+", "")
            $string2 = StringReplace($string2, "[", "")
            $string2 = StringReplace($string2, "]", "")
            $string2 = StringReplace($string2, "{", "")
            $string2 = StringReplace($string2, "}", "")
            $string2 = StringReplace($string2, "\", "")
            $string2 = StringReplace($string2, ";", "")
            $string2 = StringReplace($string2, ":", "")
            $string2 = StringReplace($string2, ",", "")
            $string2 = StringReplace($string2, "<", "")
            $string2 = StringReplace($string2, ".", "")
            $string2 = StringReplace($string2, ">", "")
            $string2 = StringReplace($string2, "/", "")
            $string2 = StringReplace($string2, "?", "")
            $string2 = StringReplace($string2, "`", "")
            $string2 = StringReplace($string2, "~", "")
            $found = _ArrayFindAll($Programs, $string2, 0, 0, 0, 1)
            If @error Then
            Else
                ConsoleWrite($programs[$found[0]] & @CRLF)
            EndIf
        EndIf
    Next
EndFunc  ;==>Compare2

Func BuildArray()
    Dim $Programs[159]
    $Programs[0] = "Agnitum Outpost Security"
    $Programs[1] = "AhnLab"
    $Programs[2] = "Aidstest"
    $Programs[3] = "Alladin Knowledge Systems"
    $Programs[4] = "Alwil Software"
    $Programs[5] = "AnchorFree Hotspot Shield"
    $Programs[6] = "Antigen"
    $Programs[7] = "AntiVir"
    $Programs[8] = "AntiVirenKit."
    $Programs[9] = "Antivirus"
    $Programs[10] = "AOL Active Virus Shield"
    $Programs[11] = "a-squared Personal"
    $Programs[12] = "Authentium"
    $Programs[13] = "Avast"
    $Programs[14] = "AVG"
    $Programs[15] = "Avira"
    $Programs[16] = "AVP"
    $Programs[17] = "BitDefender"
    $Programs[18] = "BOClean"
    $Programs[19] = "BullGuard"
    $Programs[20] = "CA Anti-Virus"
    $Programs[21] = "Cat Computer Services"
    $Programs[22] = "CAT-QuickHeal"
    $Programs[23] = "CCleaner"
    $Programs[24] = "Central-Point Antivirus"
    $Programs[25] = "Cisco Security Agent"
    $Programs[26] = "ClamAV"
    $Programs[27] = "ClamTk"
    $Programs[28] = "ClamWin"
    $Programs[29] = "ClamXav"
    $Programs[30] = "Command Antivirus"
    $Programs[31] = "Comodo AntiVirus"
    $Programs[32] = "Computer Associates"
    $Programs[33] = "CounterSpy"
    $Programs[34] = "dLight"
    $Programs[35] = "Dr. Solomon"
    $Programs[36] = "Dr.Web"
    $Programs[37] = "DriveSentry"
    $Programs[38] = "E Scan"
    $Programs[39] = "Eliashim"
    $Programs[40] = "eSafe"
    $Programs[41] = "Eset Software"
    $Programs[42] = "eTrust Antivirus"
    $Programs[43] = "Ewido Security Suite"
    $Programs[44] = "File Protector"
    $Programs[45] = "Finjan Software"
    $Programs[46] = "Fortinet"
    $Programs[47] = "FortKnox Personal Firewall"
    $Programs[48] = "F-PROT"
    $Programs[49] = "Freedom Anti-Virus"
    $Programs[50] = "Frisk Software"
    $Programs[51] = "F-Secure"
    $Programs[52] = "G Data"
    $Programs[53] = "GeCAD Software"
    $Programs[54] = "GFI Mail Essentials"
    $Programs[55] = "Graugon AntiVirus"
    $Programs[56] = "Grisoft"
    $Programs[57] = "H+BEDV"
    $Programs[58] = "Hacksoft"
    $Programs[59] = "Hauri"
    $Programs[60] = "IBM Proventia Desktop"
    $Programs[61] = "Ikarus"
    $Programs[62] = "Integrity Master"
    $Programs[63] = "InVircible"
    $Programs[64] = "Iolo Personal Firewall"
    $Programs[65] = "Jetico Personal Firewall"
    $Programs[66] = "K9 Web Protection"
    $Programs[67] = "Kaspersky"
    $Programs[68] = "Kerio WinRoute Firewall"
    $Programs[69] = "KlamAV"
    $Programs[70] = "Lavasoft Ad-Aware"
    $Programs[71] = "LinuxShield"
    $Programs[72] = "Mail Essentials"
    $Programs[73] = "MailScan"
    $Programs[74] = "Malwarebytes AntiMalware"
    $Programs[75] = "McAfee"
    $Programs[76] = "Microsoft RootkitRevealer"
    $Programs[77] = "Microsoft Windows Live OneCare"
    $Programs[78] = "MicroWorld Technologies"
    $Programs[79] = "Mikko Technology"
    $Programs[80] = "MKS"
    $Programs[81] = "Network Associates"
    $Programs[82] = "NetZ Computing"
    $Programs[83] = "NOD32"
    $Programs[84] = "Norman ASA"
    $Programs[85] = "Norton Antivirus "
    $Programs[86] = "nProtect"
    $Programs[87] = "Online Armor"
    $Programs[88] = "OpenAntiVirus"
    $Programs[89] = "Panda"
    $Programs[90] = "PC Tools"
    $Programs[91] = "PC-cillin"
    $Programs[92] = "PeerGuardian"
    $Programs[93] = "PER Antivirus"
    $Programs[94] = "PestPatrol"
    $Programs[95] = "Prevx1"
    $Programs[96] = "Proland Software"
    $Programs[97] = "Protector Plus"
    $Programs[98] = "Provides Quick Heal"
    $Programs[99] = "Quick Heal Antivirus"
    $Programs[100] = "RAV antivirus"
    $Programs[101] = "Rising"
    $Programs[102] = "SafeTNet"
    $Programs[103] = "Softwin"
    $Programs[104] = "Sophos"
    $Programs[105] = "Spyblocker"
    $Programs[106] = "Spybot S&D"
    $Programs[107] = "Spybot Search & Destroy"
    $Programs[108] = "Spysweeper"
    $Programs[109] = "Spyware Blaster"
    $Programs[110] = "Sunbelt"
    $Programs[111] = "SurfinGuard"
    $Programs[112] = "Suspicious"
    $Programs[113] = "Sybari"
    $Programs[114] = "Symantec"
    $Programs[115] = "The Antidote"
    $Programs[116] = "The Cleaner"
    $Programs[117] = "TheHacker"
    $Programs[118] = "Thunderbyte"
    $Programs[119] = "Trend Micro"
    $Programs[120] = "Trojan Remover"
    $Programs[121] = "TrojanHunter"
    $Programs[122] = "Turbo Antivirus"
    $Programs[123] = "V3 Pro Deluxe"
    $Programs[124] = "V3Manager"
    $Programs[125] = "V3Net"
    $Programs[126] = "V3Pro 2004"
    $Programs[127] = "VBA32"
    $Programs[128] = "VBShield"
    $Programs[129] = "VCatch"
    $Programs[130] = "V-COM AntiVirus"
    $Programs[131] = "ViRobot"
    $Programs[132] = "Virus Chaser"
    $Programs[133] = "VirusBuster"
    $Programs[134] = "Webroot Desktop Firewall"
    $Programs[135] = "Webwasher-Gateway"
    $Programs[136] = "Windows Defender"
    $Programs[137] = "Windows Live OneCare"
    $Programs[138] = "Winpooch"
    $Programs[139] = "ZeroKnowledge"
    $Programs[140] = "ZoneAlarm"
    $Programs[141] = "Antispyware"
    $Programs[142] = "Anti-Spyware"
    $Programs[143] = "Anti Spyware"
    $Programs[144] = "Anti-Virus"
    $Programs[145] = "Anti Virus"
    $Programs[146] = "Antimalware"
    $Programs[147] = "Anti-Malware"
    $Programs[148] = "Anti Malware"
    $Programs[149] = "Firewall"
    $Programs[150] = "Spyware"
    $Programs[151] = "Malware"
    $Programs[152] = "Adware"
    $Programs[153] = "AntiAdware"
    $Programs[154] = "Anti-Adware"
    $Programs[155] = "Anti Adware"
    $Programs[156] = "Anti"
    $Programs[157] = "Blocker"
    $Programs[158] = "Defender"
EndFunc  ;==>BuildArray

But of course, that top one, doesn't display everything I want it too, nor does it actually display based on partial matches. This is not a bad program that's going to be written, the purpose would be to faciliate software inventory based on category master lists so that things don't have to be broken down manually.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites



If I understood this correctly, you want to have your array which like so:

$data[0] = "This"
$data[1] = "is a"
$data[2] = "test of the"
$data[3] = "emergency broadcasting system today"
$data[4] = "and here is"
$data[5] = "the reason"
$data[6] = "for"
$data[7] = "my call"
$data[8] = "back to you"
$data[9] = "if that is okay."

and you want to split it into words, but you also want to know where the original word came from in the old array? Maybe try a 2D array:

$array[0][0] = Count
$array[1][0] = 0; Original index
$array[1][1] = "This"
$array[2][0] = 1; Original index
$array[2][1] = "is"
$array[3][0] = 1; Original index
$array[3][1] = "a"

Well I tried that, and this is how I went:

#include <Array.au3>
Global $data[10]
$data[0] = "This"
$data[1] = "is a"
$data[2] = "test of the"
$data[3] = "emergency broadcasting system today"
$data[4] = "and here is"
$data[5] = "the reason"
$data[6] = "for"
$data[7] = "my call"
$data[8] = "back to you"
$data[9] = "if that is okay."

$aNew = _TransformMyArrayExlamationPt ($data, 0)
_ArrayDisplay ($aNew)

Func _TransformMyArrayExlamationPt ($aOrr, $first)
    Local $iDex = 1
    Local $aRet[1][2]
    For $i = $first To UBound ($aOrr) - 1
        $aSplit = StringSplit ($aOrr[$i], " ")
        ConsoleWrite ("ReDim $aRet[" & $iDex + $aSplit[0] & "][2]" & @CRLF)
        ReDim $aRet[$iDex + $aSplit[0]][2]
        For $x = 1 to $aSplit[0]
            ConsoleWrite ("Setting $aRet[" & $iDex & "][0] = " & $i & @CRLF)
            ConsoleWrite ("Setting $aRet[" & $iDex & "][1] = " & $aSplit[$x] & @CRLF)
            $aRet[$iDex][0] = $i
            $aRet[$iDex][1] = $aSplit[$x]
            $iDex += 1
        Next
    Next
    Return $aRet
EndFunc

I should mention it worked on the second try (where all I had to do was move $iDex += 1..). It makes me very happy to be able to start to manipulating arrays on the first few tries... :)

Cheers,

Brett

Share this post


Link to post
Share on other sites

Is that what you meant about all this. I was thinking you wanted a search with OR and a listing of each possible overlay. Just like the web searches are found. If so then do say something to that manner


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

For example:

Global $data[10]
$data[0] = "This"
$data[1] = "is a"
$data[2] = "test of the"
$data[3] = "emergency broadcasting system today"
$data[4] = "and here is"
$data[5] = "the reason"
$data[6] = "for"
$data[7] = "my call"
$data[8] = "back to you"
$data[9] = "if that is okay."oÝ÷ Ù:k+zËA®q«-xÊË^Mx÷
.ת¹©t½êöjwwÂ¥u·­ê''±qêmôߧZµ­

So $data[2][0] would equal 33 and $data[3][0] would equal 75. It would be alot harder but still equal to find if:

Broadcasting today test: broadcasting system

broadcasting has 2 options so now I would still think of 25 but now add one more to the total (4/100) has now changed to (5/100) so the $data[3][0] would equal 80% now. There are so many different option to choose from but it is up to you what way you want it


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

Hey why don't u just use the "StringInStr" function. If u have a string having "is a" and if u have to search a string "Howy is a good guy", then u can simply use StringInStr function. It searches for a substring inside a string.

It wud work as u wish.


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites

Think of it like creating a super massive list of known gaming applications (omg that's a huge list), and this list is sorted, but setup such a way that "Microsoft Flight Simulator 2005" and "microsoft flight simulator 2007" would actually be as only one element in the master list: "Microsoft Flight Simulator". This way, when the search term "Microsoft flight simulator 2005" is thrown against the master list, it does indeed find the "microsoft flight simulator", but returns the search result as the one found, instead of the result in the master list. It's more of a confirmation thing, hey, yes, the game exists, it's in the list, now return it so that we can see it.

Ahhh, I just got what he has doing now, I thought he had "Microsoft Flight Simulator 2007" as a master list searching "Microsoft Flight Simluator 2005" would results in at least 75% or greater. However you said Microsoft Flight Simulator would seek out each 2005 and 2007 of those words. My fault, but my way is something like searching web pages with a OR for each word you say


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

If you don't mind me asking why are you creating a huge list of Antivirus software? :)

Share this post


Link to post
Share on other sites

If you don't mind me asking why are you creating a huge list of Antivirus software? :)

As outlined in my origional post, i'm doing software inventory of over 23,000 computers. All of these computers are used by our companies contractors, but we don't control what's on there. But, we do need to know what applications exist in 3 major categories: Office, Security and Development. Instead of just showing us the entire list of applications installed, which would not be very friendly to the contractor, we only want to see software in those categories get sent back to us.

But, after thinking about it, I think I can solve my problem here by reversing the logic. Instead of using the installed applications on the machine as the search term, i'll use the installed applications as the master list, and use the category array as the search term. This way, since the category list is rather general:

avast
mcafee
norton
symantec
nod32
esset

or

Microsoft Office
OpenOffice
Abby Office
Sun Office

Etc, I can use those terms to search against the installed applications and return the installed application as the result *sighs*. Hopefully that does what I need :lmao:


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

i think _arraysearch would help you lots here

#Include <Array.au3>
_ArraySearch(Const ByRef $avArray, $vValue[, $iStart = 0[, $iEnd = 0[, $iCase = 0[, $iPartial = 0[, $iForward = 1[, $iSubItem = 0]]]]]])

I had tried arraySearch but it didn't find a dang thing :) Using ArrayFindAll showed actual results, esp as it's based on ArraySearch :lmao:


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

But, after thinking about it, I think I can solve my problem here by reversing the logic. Instead of using the installed applications on the machine as the search term, i'll use the installed applications as the master list, and use the category array as the search term. This way, since the category list is rather general:

That's what I've been testing and I think I have a workable solution for you.

But I have a question: Do you in fact want all matches returned for a single entry?

ie: if the system has both Office XP and Office 2003 installed, do you want both results returned?

I'm thinking you do, but just want to make sure.

Share this post


Link to post
Share on other sites

That's what I've been testing and I think I have a workable solution for you.

But I have a question: Do you in fact want all matches returned for a single entry?

ie: if the system has both Office XP and Office 2003 installed, do you want both results returned?

I'm thinking you do, but just want to make sure.

Yep, sure do. Right now, i have adapted this script to work via functions, etc. It works great. Finds installed programs, and finds running services, annotates them, and adds them to the list. Granted, there are some exclusions that exist, etc, but it was fun.

Func beg2()
    BuildArray()
    Dim $Software
    Dim $data[1]
    _ComputerGetSoftware($Software)
    If @error Then
        $Extended = @extended
        Switch $Extended
            Case 1
                _ErrorMsg("Array contains no data.")
        EndSwitch
    EndIf
    For $i = 0 To $Software[0][0] - 1 Step 1
        _ArrayAdd($data, "Installed:  " & $Software[$i][0])
    Next
EndFunc  ;==>beg2

Func BeginScan()
    Dim $results[1]
    BuildArray()
    _ComputerGetServices($services, "Running")
    If @error Then
        $Extended = @extended
        Switch $Extended
            Case 1
                _ErrorMsg($ERR_NO_INFO)
            Case 2
                _ErrorMsg($ERR_NOT_OBJ)
        EndSwitch
    EndIf
    $num = $services[0][0]
    For $i = 1 To $services[0][0] Step 1
        _ArrayAdd($data, "Service: " & $services[$i][7])
    Next
    Compare()
    $fixed = _ArrayDeleteClones($results)

EndFunc  ;==>BeginScan

Func Compare()
    $string = _ArrayToString($data, "|")
    $string2 = _ArrayToString($Programs, "|")
    $string3 = StringReplace($string2, " ", "|")
    $string3 = $string2 & "|Protector Plus|PER Antivirus|PC Tools|G Data|PC Heal|Family Safety"
    $split = StringSplit($string3, "|")
    For $i = 0 To UBound($split) - 1 Step 1
        $chk = 0
        While 1
            $chk += 1
            $found = StringInStr($string, $split[$i], 0, $chk)
            If $found <> 0 Then
                $comstring = StringTrimLeft($string, $found - 1)
                $result = StringRegExp($comstring, "(.*?)\|(?:.*?\z)", 1, 1)
                If @error Then
                Else
                    Call("recombine", $result[0], $found - 1)
                EndIf
            Else
                ExitLoop
            EndIf
        WEnd
    Next
EndFunc  ;==>Compare

Func recombine($term, $count)
    $term = StringTrimLeft($string, $count)
    If StringLeft($term, 1) <> "|" Then
        Call("recombine", $term, $count - 1)
    Else
        $result2 = StringRegExp($term, "\|(.*?)\|(?:.*?\z)", 1, 1)
        If @error Then
        Else
            If StringInStr($result2[0], "Update ", 0) OR StringInStr($result2[0], "Ghost", 0) OR StringInStr($result2[0], "Partition", 0) Then
            Else
                GUICtrlSetData($resultlist, $result2[0])
            EndIf
        EndIf
    EndIf
EndFunc  ;==>recombine

Func _ArrayDeleteClones($sArray)
    If Not IsArray($sArray) Then Return SetError(1)
    If UBound($sArray, 0) > 1 Then Return SetError(2)
    Local $NewArr[1], $IsFound = 0, $NewArrCnt = 0, $Extended = 0
    For $i = 1 To UBound($sArray) - 1
        $IsFound = 0
        For $j = 1 To UBound($NewArr) - 1
            If $sArray[$i] = $NewArr[$j] Then
                $IsFound = 1
                $Extended += 1
                ExitLoop
            EndIf
        Next
        If Not $IsFound Then
            $NewArrCnt += 1
            ReDim $NewArr[$NewArrCnt + 1]
            $NewArr[$NewArrCnt] = $sArray[$i]
        EndIf
    Next
    $NewArr[0] = UBound($NewArr) - 1
    Return SetError(0, $Extended, $NewArr)
EndFunc  ;==>_ArrayDeleteClones

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

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
Sign in to follow this  
Followers 0