Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to return multiple values from QTP User defined function
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi, I am new in QTP. I have to use three return values of a function. I can store one value to function name say fnGetVal = intRowNo.

In below function I have to read values from MsAccess table & store it in array arrRowVal() , total rows count in intRowNo & pass/fail value in strResult. The function is in Library part, arrRowVal is declared before starting function as Dim arrRowVal()


Code:
function fnGetVal(Sql,  intRowNo,  arrRowVal() ,  strResult)

'-- code to read access table & store in array arrRowVal, count in intRowNo, result pass/fail in strEndResult.

End function


'===== call code
Code:
strSql="Select SrNo,Name from ABCtbl where Flag = '1' "
  strErrorMessage=fnGetVal(strSql, intCount, arrRowVal, strResult)

Note : I am not sure the parameter arrRowVal is correct to pass or not in fnGetVal. Getting General error if arrRowVal() is written.


The function is working fine , but how to get the values stored in intRowNo, arrRowVal() , strEndResult in call code script.

Thanks in advance.
Dinesh
Reply


Messages In This Thread
How to return multiple values from QTP User defined function - by dineshb - 12-04-2009, 04:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP/UFT - Storing Multiple Arrays In An Array Eitel13 0 1,794 07-17-2018, 04:37 PM
Last Post: Eitel13
  UFT 12.02 Compatibility for IE 11.0 : Fail to identify the defined Object Amruta_121 9 11,155 01-11-2016, 12:45 PM
Last Post: vinod123
  Childobject return wrong checkbox count.. VpnQTP 1 2,845 04-09-2015, 09:07 PM
Last Post: babu123
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,963 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  Does QTP supports to open same application multiple times!!!!! pkiran169 1 2,952 08-07-2013, 01:09 PM
Last Post: anil2u

Forum Jump:


Users browsing this thread: 2 Guest(s)