Jump to content
Sign in to follow this  
bradadair

Newbie with strange issue

Recommended Posts

bradadair

I am new to AutoIT and I am having a strange issue that I am hoping some one can help me with. I have a script that I have written to monitor certain processes and display a message box if one of them is not running. When I run it on my machine it runs fine whether I run the script file or the exe that I compiled.

When I put the exe on another machine however, I get an error message that states 'Line 15 variable used without being declared'. I don't understand why I don't get this error on my machine but do on another. If anyone has any insight it would be appreciated. The code for the script is below.

func checkProcesses()
    Dim $status
    Dim $afis = 9
    Dim $as1 = processExists("auth_svr_odbc.exe")
    Dim $cardCcol = processExists("card_col_odbc.exe")
    Dim $comm = processExists("comm_svr_odbc.exe")
    Dim $job = processExists("mapper_odbc.exe")
    Dim $nstdmn = processExists("nist_dmn_odbc.exe")
    Dim $prndmn = processExists("prn_dmn.exe")
    Dim $region = processExists("reg_sm_odbc.exe")
    
    If $afis == 0 Then
        $status = "AFIS"
    ElseIf $as1 == 0 Then
        $status = "AS1"
    ElseIf $cardCol == 0 Then
        $status = "COLL11"
    ElseIf $comm == 0 Then
        $status = "COMM"
    ElseIf $job == 0 Then
        $status = "JOB"
    ElseIf $nstdmn == 0 Then
        $status = "NSTDMN"
    ElseIf $prndmn == 0 Then
        $status = "PRNDMN"
    Else
        $status = "OK"
    EndIf
    
    return $status
    
EndFunc

While 1
    $check = checkProcesses()

    if $check <> "OK" Then
        msgBox(0, "Process Down", "Process " & $check & " is down!")
        sleep(60000)
    Else
        sleep(60000)
    EndIf
WEnd

Share this post


Link to post
Share on other sites
bradadair

It does not say which variable. I will try and take a screen shot of the error that I am getting and post it.

Yes this is the whole code for now. I was just trying to get a base working that I could build on.

Share this post


Link to post
Share on other sites
bradadair

Here is a screen shot of the error that I am getting.

post-56450-12676445217595_thumb.jpg

Share this post


Link to post
Share on other sites
bradadair

Thank you! I guess I stared at it to long and couldnt see it!

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
bradadair

Thanks everyone for your assistance. I really appreciate it as I am trying to learn.

Also, does anyone have any idea why I would not get the error that I was getting about the variable when running on my machine but only when running on a different machine? I am just trying to understand the behavior.

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

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  

×