Ask a Question

How to use a variable in WinFormsObject() in VBScript?

SOLVED
mcastellanos
Occasional Contributor

How to use a variable in WinFormsObject() in VBScript?

I want to pass a parameter to below line for "txtPatterName" but TC complete fails to evaluate.

myparam = "txtPatterName"

 

Set Obj = Sys.Process("GemCat_Gui").WinFormsObject("frmPatternMetaData").WinFormsObject("grpPatternID").WinFormsObject("txtPatterName")

 

I am aiming to something like (not sure if concatenation if right):

Set Obj = Sys.Process("GemCat_Gui").WinFormsObject("frmPatternMetaData").WinFormsObject("grpPatternID").WinFormsObject(" & myparam & ")

1 REPLY 1
HKosova
SmartBear Alumni (Retired)

Hi mcastellanos,

 

You need to change
WinFormsObject(" & myparam & ")
to
WinFormsObject(myparam)

 

It doesn't need quotes and concatenation because myparam is already a string.

 

P.S. I moved your question to a separate thread. In the future, please do not reply to old threads with questions that are not related to the original topic. Thanks!


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: