VBScript is not working with String arguments

I am trying to send String as argument to VbScript. But it is not working. When I send Integers it is working. As shown below when ‘rev’ with ‘VBScript’ value it is not getting reversed. But when I send rev as Int (like 123) it is getting reversed. Please suggest.

Code:

set rev to ‘VBScript’

Set VBCode to ‘s = StrReverse(’ + rev + ‘): wScript.Echo s’

System.RunVBScript VBScriptCode: VBCode
ScriptError=> ScriptError
ScriptOutput=> ScriptOutput

Console.Write Message: ScriptOutput
Console.Write Message: ScriptError

Output:

Checking script…
Loading robot…
Running script…

Execution completed successfully.

Hi Murali,
looks as if the VBScript code you use is not ‘correct’.

When I use this code:
set rev to “VBScript”

Set VBCode to ‘wScript.Echo StrReverse("’ + rev + ‘")’

System.RunVBScript VBScriptCode: VBCode
ScriptError=> ScriptError
ScriptOutput=> ScriptOutput

Console.Write Message: ScriptOutput
Console.Write Message: ScriptError

I’ll get:
Checking script…
Loading robot…
Running script…
tpircSBV

Execution completed successfully.

4 Likes

Thanks a lot. Will give it a try.