Is it possible to return multiple values from a function..?
Then how..?

Answer Posted / satish j

It is possible to return multiple values from a function?
Here I am taking the return values in an array and using
them as I want

mynum1 = 0
mynum2 = 0
dim linklist(2)
imax = ubound(linklist)

Function fncl1(ByRef mynum1,mynum2, x , y)
If i= 0 Then
z = "+"
Select Case z
case "+"
mynum1 = x +y
msgbox mynum1
fncl1 = mynum1
End select
else
z = "-"
Select Case z
case "-"
mynum2 = x- y
msgbox mynum2
fncl1 = mynum2
End Select
end if
End Function

For i=0 to imax
linklist(i) = fncl1(mynum1,mynum2,5,4)
If linklist(i) = mynum2 Then
Exit for
End If
Next

msgbox linklist(0)+linklist(1)
msgbox linklist(0)&","&linklist(1)

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How you can find length of array in qtp?

548


What are the factors on which script execution time is dependent?

617


What are the types of properties that quick test learns while recording?

540


What is a data driven test in qtp?

591


Explain advantages and disadvantages of ddf?

603






i have asked earlier only one question how to test web application using QTp plz send me the answer quickly

1662


Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya

1427


How you can delete excel file in qtp?

599


Hi, Can we open a test in qtp10 which is saved in qtp 9.2?

1440


What are the key points to create a framework in QTP for oracle forms?

1819


I am trying to install QTP 9.5 but i am getting error message saying that ("Path is \QuickTest Professional\bin\vb_init.exe") vb_init.exe file is not find. can anybody give me the advise what to do ?

1769


diff between qtp versions from 8.5

1573


How to find the difference between 2 dates in qtp?

589


am not having intrest in coding lang like c c++ java etc can i choose Testing tools as my carrier and please suggest me which tool is good (suitable for me)

1284


Explain the check points in quicktest professional?

548