bradadair Posted March 3, 2010 Posted March 3, 2010 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. expandcollapse popupfunc 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
JohnOne Posted March 3, 2010 Posted March 3, 2010 It will normally tell you which variable it does not like. What is it? Is this the whole code ? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
bradadair Posted March 3, 2010 Author Posted March 3, 2010 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.
bradadair Posted March 3, 2010 Author Posted March 3, 2010 Here is a screen shot of the error that I am getting.
JohnOne Posted March 3, 2010 Posted March 3, 2010 If you run the code rather than the compliled code from scite, you will most likeky get heads up of the particular variable, in the output console. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JohnOne Posted March 3, 2010 Posted March 3, 2010 this is your error look at these $cardCol $cardCcol AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
bradadair Posted March 3, 2010 Author Posted March 3, 2010 Thank you! I guess I stared at it to long and couldnt see it!
bradadair Posted March 3, 2010 Author Posted March 3, 2010 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now