Jump to content

Recommended Posts

Posted

Hello everybody,

i'am doing a script who will be executed in background with a endless loop (While 1...WEnd).
My question is about a prospective slow-down of user's computer because script is in background. My script read one time a excel file (30 000 entries), stock it in an array. Wait and when user is on a special webpage, my script browse the array and show a popup.

Here is my script :

; Read file and stock it in a variable
Local $contacts = _ArrayFileToArray("myfile.csv", ';')

While 1
    ; Wait to be on the webpage
    Local $title = "my special webpage - Windows Internet Explorer"
    WinWaitActive($title)
    
    ; Get value of a input text called myId
    $oIE = _IEAttach($title, 'windowtitle')
    Local $oForm = _IEGetObjByName($oIE, "myId")
    $id = _IEFormElementGetValue($oForm)
    
    ; Check nb time that myId is in array
    Local $nbContact = 0
    For $i = 0 To UBound($contacts)-1 
        If $contacts[$i][3] = $id Then
            $nbContact += 1
        EndIf
    Next
    MsgBox(1,"myWindow", "L'identifiant " & $id & " is " & $nbContact & " time")
    
    WinWaitNotActive($title)
    Sleep(1000)
WEnd

 

On my computer, all is ok, i have no slowness for the time being. But my computer is best than user's computer. They have 2Mo RAM, CPU 2.7 Ghz.

Have you ever met trouble with script in background ?
Have you some good practices to optimize script in background ?

Thank's a lot

Bye

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
×
×
  • Create New...