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
Your roles and responsibilities and daily tasks? (As automation tester)
How to Test the mainframe application?
What is the parameterization? Give one example?
If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?
what testplan contents and what test strategy contents,what is the diff b/w them
What is the limitation to XML Checkpoints?
how do u plan test automation?
What are the differences between qtp and winrunner?
How to save your test using quicktest professional (qtp)?
How to make qtp understand the difference amongst the same type of objects .suppose there are 5 check boxes in a page and I have to choose the 2nd one, how to do that through script?
What are the different types of checkpoints?
Hi I know two types of testing processes. 1. Reaquirments stage,test design,code review's, Design review's, Test Plan, Test Cases design, test execution, Defect Reporting and tracking, UAT, Signoff. 2.Test Initiation , Test Plan, Test Design, Execution,Bug tracking, UAT, Sign off.
With what extension you can save the list of tests in a file to run in test batch runner?
Can UFT be connected to Quality Center? If ‘Yes’ brief the process or steps.
How to execute the WR Script through QTP? I have WinRunner script with initialization script, common scripts, GUI AND functions. I connected WR through QTP with "call to WinRunner" option but I am getting problem after connecting to WinRunner i.e. showing "Do you want to quit now" with 'yes' and 'No' message box