Forum Discussion
HKosova
13 years agoSmartBear Alumni (Retired)
Hi Amy,
Thanks for calling our attention to some missing information in the documentation. We'll improve it.
To pass parameters to the Sub or Function being called, you need to embed them in the string passed to Execute/Eval:
Thanks for calling our attention to some missing information in the documentation. We'll improve it.
To pass parameters to the Sub or Function being called, you need to embed them in the string passed to Execute/Eval:
Execute "Call UnitName.SubWithParams(1, ""string"", True)" ' Using syntax with the Call keyword and parentheses
Execute "UnitName.SubWithParams 1, ""string"", True" ' Syntax without the Call keyword and parentheses
res = Eval("UnitName.FunctionWithParams(1, ""string"", True)")
' Inserting parameter values dynamically
strFunctionCall = aqString.Format("UnitName.FunctionWithParams(%d, ""%s"", %s)", 42, "string", CStr(True))
res = Eval(strFunctionCall)
Related Content
- 2 years agoianlop