AutoIT Error:incorrect Number of parameters in function call... Need help

vaish

Solid State Member
Messages
6
Hi All,

I running following scripts using AutoIT.

I found following error after commenting/modified one line in my script.

Before modification:

;Delete IMacros Object
$iMacros.iimDisplay("Testing is finished...")
$iMacros.iimExit()

After Modification: (Just I have commented $iMacros.iimExit() function)

;Delete IMacros Object
$iMacros.iimDisplay("Testing is finished...")
;$iMacros.iimExit()

I got the error after modication of that line;

Error:incorrect Number of parameters in function call

Please do the needful...



Script:

Func main()
;Creating IMacros Object
Global $iMacros = ObjCreate("IMacros")
Global $iRet
If Not IsObj($iMacros) Then
KConsoleWrite("IMacro Object not created successfully")
KConsoleWrite("Closing Program", 1)
Else
if StringInStr($isVisible, "no") Then
$iRet = $iMacros.iimInit("-tray")
Else
$iRet = $iMacros.iimInit()
EndIf
$count = 0
While $iRet = -1
$count = $count + 1
KConsoleWrite("IMacro not initialized successfully. Retrying")
if StringInStr($isVisible, "no") Then
$iRet = $iMacros.iimInit("-tray")
Else
$iRet = $iMacros.iimInit()
EndIf
Sleep(2000)
If $count = 6 Then
KConsoleWrite("IMacro not initialized successfully.")
KConsoleWrite("Exiting with error code " & $iRet, 1)
ExitLoop
EndIf
WEnd
EndIf

;the two routines that you need to run
Global $iMacroTorun = Eval("imacrosFile")
Global $iMacroStatus

$iMacros.iimDisplay("Testing is in Progress...")
IMacrosSetArguments()
$iMacroStatus = IMacrosPlay($iMacroTorun)
IMacrosCheckError($iMacroStatus)

;Delete IMacros Object
$iMacros.iimDisplay("Testing is finished...")
;$iMacros.iimExit()

;Handle Comparision
if IsDeclared("Comparison") Then
;Read output file into variable
local $text=KFileReadToArray(eval("outputFile"))
if $text[0] = 0 Then
KConsoleWrite("Imacros Ext gave empty output",1)
EndIf

;stripping leading and trailing white spaces
local $mytext = StringStripWS($text[1], 3)
;stripping any double quote char
$mytext = StringReplace($mytext,'"',"")

Switch eval("Comparison")
Case "equal"
if $mytext = eval("Pattern") Then
KConsoleWrite("Equal passed: "&eval("Pattern"))
Else
KConsoleWrite("Equal failed: " & $mytext & ", while looking for " & eval("Pattern"))
$programExitCode=1
EndIf
Case "lessthan"
if int($mytext) <= int(eval("Pattern")) Then
KConsoleWrite("Less Than passed: " &$mytext & " is less than " & eval("Pattern"))
Else
KConsoleWrite("Less Than passed: " &$mytext & " is not less than " & eval("Pattern"))
$programExitCode=1
EndIf
Case "lessthanequal"
if int($mytext) < int(eval("Pattern")) Then
KConsoleWrite("Less Than passed: " &$mytext & " is less than or equal " & eval("Pattern"))
Else
KConsoleWrite("Less Than passed: " &$mytext & " is not less than or equal " & eval("Pattern"))
$programExitCode=1
EndIf
Case "greater"
if int($mytext) > int(eval("Pattern")) Then
KConsoleWrite("Less Than passed: " &$mytext & " is greater than " & eval("Pattern"))
Else
KConsoleWrite("Less Than passed: " &$mytext & " is not greater than " & eval("Pattern"))
$programExitCode=1
EndIf
Case "greaterequal"
if int($mytext) >= int(eval("Pattern")) Then
KConsoleWrite("Less Than passed: " &$mytext & " is greater than " & eval("Pattern"))
Else
KConsoleWrite("Less Than passed: " &$mytext & " is not greater than " & eval("Pattern"))
$programExitCode=1
EndIf
Case Else
KConsoleWrite("Invalid Compare option: "&eval("Compare"),1)
EndSwitch
EndIf
EndFunc
 
Back
Top Bottom