Micro Focus QTP (UFT) Forums
Using Variables for calling a method in a class - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Using Variables for calling a method in a class (/Thread-Using-Variables-for-calling-a-method-in-a-class)



Using Variables for calling a method in a class - chitu576 - 12-05-2014

Hi,

I am unable to use variable to call a method in a class. Please see the below code.

Code:
Class Abc
    Function FGH()
      ...
    End Function
End Class

Set abc=New ABC
sFunction="FGH"
1.abc.sFunction
2."abc"&"."sFunction
I have tried the above two scenarios, but both fails in UFT. Please guide me how to call this function when it is stored in a variable

Appreciate the time in advance!!