SystemUtil.Run in UFT gives me “invalid procedure call or argument”, Why?

0
0

I’m using SystemUtil.Run (pathName) in UFT, VBScript. But it gives me

invalid procedure call or argument.

I’m sure about pathName, I’m sure about the command, I’m sure about everything. What do you think might be the cause?

  • You must to post comments
0
0

If you look at the examples here, you’ll see that the approved call is

SystemUtil.Run pathName

(passing pathName per reference) instead of

SystemUtil.Run (pathName)

(passing a const copy).

Eric Lippert’s essay should help you to understand the use of () in VBScript.

Evidence:

As I don’t use UFT, I can only use .NET to demonstrate that the ()/parameter passing mode matters:

>> Set m_oSB = CreateObject("System.Text.StringBuilder")
>> aData = Split("a b c")
>> m_oSB.AppendFormat_4 "{0}-{1}-{2}", (aData)
>> WScript.Echo m_oSB.ToString()
>>
a
-b-c
>> m_oSB.AppendFormat_4 "{0}-{1}-{2}", aData
>>
Error Number: 5
Error Description: Invalid procedure call or argument
>>
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website