Sign in to follow this  
Followers 0
oleg

Compare Two Arrays

3 posts in this topic

#1 ·  Posted (edited)

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 !

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$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.

 

Share this post


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

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