How many ways return more then one value from function?
Answer Posted / 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 View All Answers
What is qtpro? What is a quick test professional?
How do you perform Regreession Testing?
How to get popup error message.
What is RTM (require ment tracebulity marix) fromate?
What are the methods of the TextStream object that are used for reading from a text file?
What are the types of object repositories? Which one is you using?
What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?
What is environment variable in qtp and why to use it?
What do you mean by checkpoints in qtp?
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
Is there any pdf or online book for QTP Scripting? Let me know more about QTP Scripting.
What are the types of properties that quick test learns while recording?
How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?
What are the flaws in water fall model and how to overcome it?
What is difference in global and action sheet in qtp?