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

In QA Testing when do you use Loadrunner vs QTP? What are the main differences between those two tools? Explain the purpose with real world scenario examples...In advance thank you!!!

2473


Did the scripts need lot of maintenance? If yes, why?

3408


What is the XML file architecture ?

1660


How does QTP identify an object?

690


What is meant by Output Value in UFT?

642






what the difference between shared repository and per action repository?

626


How to modify the text checkpoint?

698


what could go wrong with test automation?

1597


What is text check point and text area check point?

695


How many types of object repository in qtp?

709


Have you used xml check point in your project?

639


I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?

679


Create flight reservation login descriptive programing (Condition: Remove the value and substitute with a variable, and then call the validation from Excel) Plz help me....... very urgent.........

1665


Want to verify notepad reports using QTP framework or any other BV script method. Can anyone share the method to achieve it? Eg. Person Name is the header and the actual name is John then how can we verify weather person name is John

2246


How to customize checkpoints with parameters?

3107