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 |
Hi, While recording a Jave based web application, its recording all my actions and the objects.And I have 5 WebEdit objects on the page and all are recorded. But while execution, at the 2 WebEdit object, its entering the value into the object (Its making a call to the AJAX, matching the value), when the control get out of this object the value is erased or cleared. Could anyone please help. I have recoreded 5 more scenarios where WebEdit is in the picture on different webpages and all are working fine. Here is my Script: Browser("Sign In").Page("Matching Workbench_3").WebEdit ("locationLookup").Set "0320 - SEATTLE-KM" Browser("Sign In").Page("Matching Workbench_3").WebEdit ("supplierNameLookup").Set "TRAMMO PETROLEUM INC" *** SupplierNameLookup is the object, which is haing an issue. And also I was using the SendString function, but it didnt work.
Does UNIX support QTP? If not what is the other tool used for Unix environment?
what is the extension for the test version of the script?
What is Unicode Compatibility?
Login to flight app, in window flight reservation set the date field and select flyfrom as Frankfurt and verify whether flyto list box has the item FrankFurt, log the results.
I have written some scripts in QTP by using older version, but I want to run them in latest version. Is there any process to do that.If so can anyone explain me?
What is the "Release Notes", what it cosists? Key components in Release Notes ?
How can i get the image text that changes dynamically? Here i have used "GetROProperty", but it's not working. I used like Ex:Browser("webmail").Page("inbox").image ("captchaimage).getroproperty("innertext/text/value")
Hi iam shankar here, right now iam working on manual testing. i want to switch over automation tool qtp, right now iam taking training class outside on qtp, please let me know the cost of QTP tool for full version, wether it's an annual subscription or monthly subscription.
How can i check all the button that are enabled in a widnows based application ? What script should i write for this ?
How to create an Action Template?
What is post recovery scenario?