Jump to content

Compare Two Arrays


oleg
 Share

Recommended Posts

Hi i want to collect a process array and after event recollect and compare with first array

$ProcessList = ProcessList()

Run ( @SystemDir&"\cmd.exe")

$NewProcessList = ProcessList()

for $i = 1 TO $NewProcessList[0][0]

If $NewProcessList[$i][0] = $ProcessList[$I][0] Then

MsgBox (0,"",$NewProcessList[$i][0]&" "&$ProcessList[$I][0])

Else

MsgBox(0,"New Process",$NewProcessList[$i][0])

EndIf

Next

What should be fixed here ?

Edited by oleg

There is a hex ( 31303030303030 ) reasons i love AutoIt !

Link to comment
Share on other sites

$ProcessList = ProcessList()

Run(@SystemDir & "\cmd.exe")
$NewProcessList = ProcessList()


For $i = 1 To $NewProcessList[0][0]
    $found = 0
    For $x = 1 To $ProcessList[0][0]
        If $NewProcessList[$i][0] = $ProcessList[$x][0] Then
            $found = 1
            ExitLoop
        EndIf
    Next
    If $found Then
        MsgBox(0, "", $NewProcessList[$i][0] & " " & $ProcessList[$x][0])
    Else
        MsgBox(0, "New Process", $NewProcessList[$i][0])
    EndIf
Next

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

$ProcessList = ProcessList()

Run(@SystemDir & "\cmd.exe")
$NewProcessList = ProcessList()
For $i = 1 To $NewProcessList[0][0]
    $found = 0
    For $x = 1 To $ProcessList[0][0]
        If $NewProcessList[$i][0] = $ProcessList[$x][0] Then
            $found = 1
            ExitLoop
        EndIf
    Next
    If $found Then
        MsgBox(0, "", $NewProcessList[$i][0] & " " & $ProcessList[$x][0])
    Else
        MsgBox(0, "New Process", $NewProcessList[$i][0])
    EndIf
Next
:lmao: Thanks

There is a hex ( 31303030303030 ) reasons i love AutoIt !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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