How many ways return more then one value from function?

Answers were Sorted based on User's Feedback



How many ways return more then one value from function? ..

Answer / suresh

what is mean by that script, which statements u can write in QTP TOOL and which statements u can write in Out side QTP? write with clesr info?

Is This Answer Correct ?    4 Yes 0 No

How many ways return more then one value from function? ..

Answer / kurubaharibabu

Dear All,
I have updated all three ways the below code..



Function func1(a,b)
Dim c(3)
c(0)=a+b
c(1)=a-b
c(2)=a*b
func1=c
End Function
x=func1(2,3)
For i=0 to ubound(x)-1
msgbox x(i)
Next
'=====================================================
Function func2()
Dim c
c=array("har","babu")
func2=c
End Function
x=func2()
msgbox x(0)
msgbox x(1)
'===========================================================
Function func3()
Set dic=createobject("Scripting.Dictionary")
dic.Add "a","apple"
dic.Add"b","bal"
dic.Add"c","cat"
Set func3=dic
End Function
Set x=func3
msgbox x.Item("a")
msgbox x.Item("b")
msgbox x.Item("c")
'============================================================
Class user
Public var
Public cat
End Class
Function func4()
Set obj=new user
obj.var="hari"
obj.cat=123
Set func4=obj
End Function
Set x=func4()
msgbox x.var
msgbox x.cat
'===================================================================

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More QTP Interview Questions

Discuss quicktest professional environment?

0 Answers  


When you open QTP, how many sheets you can see?

0 Answers   Wells Fargo,


Is it possible to merge two object repository files in qtp?

0 Answers  


How Does Run time data (Parameterization) is handled in QTP?

4 Answers   IBM,


how to find that a file has been completely downloaded or not? I told that "download Complete" pop up. but he told the tool doesn't recognize the pop up

1 Answers   Mphasis,






how to parameterizing values from an excel sheet in Quick test professional?

1 Answers  


How the QTP recognize, handle n reports that a error has been handled by it(QTP) when we perform a recovery scenario in our application n in what manner it will display it in resulting window? Plz help me out.

1 Answers  


Which features or drawbacks of QTP lead to the upgrade for a newer version?

0 Answers  


in Qtp,how to display user name and pwd (script)in data table(global sheet).

2 Answers  


What the genaric function to connect Sql Server using Sql Server Authentication and Windows Authentication

1 Answers  


how can you describe the basic flow of automation with conditional and programmatic logic?

1 Answers   Ordain Solutions,


How can we log a defect in Testdirector from Q.T.P ?

2 Answers   EDS,


Categories