How to return a value from a fn, if it has more than one value
how to return

Answers were Sorted based on User's Feedback



How to return a value from a fn, if it has more than one value how to return..

Answer / bantanahal haribabu

Dim odd()
cnt=0
Function oddnum(srange,erange)
For i=srange to erange
If i mod 2<>0 Then
ReDim preserve odd(cnt)
odd(cnt)=i
cnt =cnt+1
End If
oddnum=odd
Next
End Function
var=oddnum(1,20)
msgbox isarray(var)
For i=lbound(var) to ubound(var)
print var(i)

Next

Is This Answer Correct ?    5 Yes 1 No

How to return a value from a fn, if it has more than one value how to return..

Answer / kishan

dim arr(4) 'declare the array if necessary
function myfunction()
....
....
....
myfunction=arr 'here arr is an array

end function




Point to Remember:
1. store req values in a array and assign that array to
function name (or)
2. Concatenate all the multiple values and assign it to
function name

Is This Answer Correct ?    2 Yes 0 No

How to return a value from a fn, if it has more than one value how to return..

Answer / ram

There is only way to return more than one value that is by using call by reference. we can call function by reference passing an object.steps
1. Create class
2. Declare more than 2 elementes
3. Create object of the class
4. Call function by passing that object


please let me know if I am wrong.


Ram

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More QTP Interview Questions

Anybody explain me, the concept of checkpoint declaration in the QTP mainly for the Objects, Pages, Text and Tables ?

1 Answers  


For QTP Test Engineer, What is his contribution to the Project? Means, As as automation test engineer what is his role in the current project?

0 Answers   V2 Solutions,


hi guys, pls tell me for testing institution training hub, hitech city is best or not?

0 Answers  


What is the limitation to XML Checkpoints?

4 Answers   CTS,


what is test data

4 Answers   Wipro,






Can you tell me the differences between writing the VB script manually for a application and recording the same application in QTP , with a example?

1 Answers  


plz anybody tell me how to explain the architecture of one particular project.plz give me answer for this.....RAJESH

7 Answers   TCS, Wipro,


What is AUT in object reposity in QTP? Why we use it in Object repository???What is full form???????

6 Answers  


When ‘option explicit’ keyword is used in qtp?

0 Answers  


how can we retrieve ten rows from the data table using loop concept?

3 Answers  


How can we extract data like "Details","Result","Time" from the 'Run Error' result generated in QTP after run time errors are generated during a run & import the details etc...into excel sheet

0 Answers  


whaht is the difference between CLASS & OBJECT?

3 Answers   Accenture,


Categories