testcomplete: identify aliases objects at run time
I am writing a script where aliases object name will be evaluated at run time. E.g. I have objects aliases with names pollRes1 through pollRes10. But I evaluate at runtime the value for a variable pollRes (which could be anything from pollRes1 through pollRes10) and then I try to perform an action on it. pollRes is a local variable in this case. But this script throws an exception “Object doesn’t support this property or method: ‘Aliases.pollRes”. Please advise.
Sub Test1 (tmpPollRes)
Re: testcomplete: identify aliases objects at run time
what you want to do is use the "Execute" statement. pollRes is a string, not an object name.
Execute "set myObj=Aliases." & "pollRes" & CStr(tmpPollRes)
if myObj.Exists then