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 are the advantages of Object Repository?
What is the difference between per-action and shared?
How do I generate Test Results window using descriptive method ( run time ) after my test execution process? Please have a look of my below code. ========================================================= Dim qtApp Dim qtTest Dim qtResultsOpt Set qtApp = CreateObject("QuickTest.Application") qtApp.Launch qtApp.Visible = True qtApp.Options.Run.CaptureForTestResults = "Always" qtApp.Options.Run.RunMode = "Fast" qtApp.Options.Run.ViewResults = True qtApp.Open "C:\Automation\Example", True Set qtTest = qtApp.Test qtTest.Settings.Run.OnError = "NextStep" Set qtResultsOpt = CreateObject ("QuickTest.RunResultsOptions") qtResultsOpt.ResultsLocation = "C:\Automation\Example\Res1" qtTest.Run qtResultsOpt MsgBox qtTest.LastRunResults.Status qtTest.Close Set qtResultsOpt = Nothing Set qtTest = Nothing Set qtApp = Nothing ========================================================== This code is working fine, but Test Result window is not displaying after execution. Anybody can please help me regading the same. Thanks Akshaya Madali Capgemini India Pvt Ltd 9823213538
hi can any body give me a script for creating a modularity or keyword driven framework..i am working as a qtp tester for 2 months but still i am not exposed to framework in my company
Explain different checkpoints in qtp.
can i change the runtime properties of an object ? How can i check if a parameter exists in database ?
Does QTP have any limitations?Can it work with all kinds of programming languages like java,springs,ajax ,hybernet?Also does it work well with windows 7.What are its other limitations
Does quicktest professional (qtp) is unicode compatible?
If you are testing a web application then what will you test in that application?
what frame work you are following?
Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay
How many types of run modes are there in qtp?
How do you convert manual test cases to automated test cases?
I want to grow as a Automation Engineer,Kindly help me in clearing my interview that what interviewer looks for as a Automation Engineer. I am having three years of experience in testing.
Explain the difference between call to action and copy action?