![]() |
GetRef - Interesting question - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: GetRef - Interesting question (/Thread-GetRef-Interesting-question) |
GetRef - Interesting question - vIns - 08-20-2012 Hi All, Please see the program. The requirement is to Capitelize the first letter of each word in a sentence. The programmer has used regular expression and getref - to connect to a function which capitelizes the first letter of a given word. This programs works as expected. My only question is - where do we pass the arguments to the function 'Capitelize'?? It expects 3 arguments. Code: Dim replacement RE: GetRef - Interesting question - Hailesh - 09-21-2019 (08-20-2012, 06:59 AM)vIns Wrote: Hi All,Hi, You must have got an error on line 'Set replacement = getRef("Capitelize")', here your function does not return any value. Also if a function as per shared example returns any value, you need to collect it in a variable. One can use getRef as per below example: Function additionFunc(a, b) additionFunc = a + b End Function x=5 y=6 Dim returnVal : returnVal = getRef("additionFunc")(x,y) print "Result is: "&returnVal |