Jump to content

Having trouble with passing params to a func


Recommended Posts

Hello all,

I am trying to pass in some params into my function but I keep getting:

"C:\Program Files\AutoIt3\bstest\bstest.au3 (949) : ==> Error in expression.:

Local $sExe = "ca_devmgr -mediainfo " & $x & " " $y & " " & $z

Local $sExe = ^ ERROR"

the call to the func is "$chknam = get_mediainfo($schg_adpt_no, $schg_scsi_no, $schg_lun_no)" the vars here are supplied by the user and are valid.

the code is:

CODE
Func get_mediainfo($x, $y, $z)

;fakes a library

;$sChanger = "0"

; this function get the media info of the loaded tape

Local $sDir = "C:\Program Files\CA\BrightStor ARCserve Backup"

Local $sExe = "ca_devmgr -mediainfo " & $x & " " $y & " " & $z

Local $sOutput = ""

Local $PID = Run($sDir & "\" & $sExe, $sDir, @SW_MINIMIZE, $STDOUT_CHILD + $STDERR_CHILD)

Do

Sleep(20)

If StdoutRead($PID, 0, 1) Then $sOutput &= StdoutRead($PID)

If StderrRead($PID, 0, 1) Then $sOutput &= StderrRead($PID)

Until Not ProcessExists($PID)

If StringInStr($sOutput, "TAPE0") Then

Return "yes"

EndIf

EndFunc

Thanks for any help

Link to comment
Share on other sites

I am trying to pass in some params into my function but I keep getting:

"C:\Program Files\AutoIt3\bstest\bstest.au3 (949) : ==> Error in expression.:

Local $sExe = "ca_devmgr -mediainfo " & $x & " " $y & " " & $z

Local $sExe = ^ ERROR"

Try:

Local $sExe = "ca_devmgr -mediainfo " & $x & " " & $y & " " & $z

:)

My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...