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
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 |
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 |
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 |
banking domain description for software tester for interview
i am unable to select an item from combobox using Descriptive programming. can any one give me code for scheduling the ticket using Descriptive programming.
Why we have to import data from excel sheet to data table?becoz v can directly use test data directly from xl know. can u all pls explain me clearly
How to use the object spy in quicktest professional 8.0 version?
What are the different recording modes?
How to handle Dynamic Arrays?
example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?
In QA Testing when do you use Loadrunner vs QTP? What are the main differences between those two tools? Explain the purpose with real world scenario examples...In advance thank you!!!
Can you tell me QTP is support for GIS(Geography Information System) Based Software.
How to load an object to a object repository at RUN TIME ?
What are the advantages of Automation objects than Test Objects?
1. What is extense of Result file in QTP?