can a Function return more than one value..??? if so please
give me the code for that.
Answers were Sorted based on User's Feedback
Answer / bantanahal haribabu
function exmp(a,b)
dim myarray(2)
myarray(0)=a+b
myarray(1)=a*b
exmp=myarray
end function
val=exmp(2,3)
msgbox isarray(val)
for i=o to ubound(val)
msgbox val(i)
next
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / prasad
Function alway returns one value. only action in QTP
returns more than one values.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / siqtp
Logically Function can return pnly one value.But we can
achieve rturning multiple values using any of the following
1)Concatenate all the values to be returned to a string and
retuen it
2)Use arrays
3)Use dictionay object
4)use ByRef
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / uday kumar _ anem
Another way to handle more than one return value is using
arrays and also use global variables.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / nath t
Function doesn't return more than one value.
if you want to get more than one result, we can write
function for that. After u will get the value u have to
split the value.
Example:
Function AddSub(a, b)
som = a + b
subt = a - b
AddSub = som&"/"&subt
End Function
this function returns only one value. But it's having two
results(i.e Addition and subtraction of two no.s).
After u will get this value. u have to split that one for
two results by using split function here delimeter is "/".
like this we can add more than one result to the return
variable(in this example AddSub is the return variable).
Is This Answer Correct ? | 2 Yes | 5 No |
In VSS, HoW the documents send to local folder? copy paste or any other? plz explain about VSS TOOL kit?
Hi, how can we check or avoid the memory leakage in QTP9.2?
how to create the varibles and how these are connect to qtp? plz tell me
What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy paste the date from QTP help. I tryed it.But I don't Understand where should we use exactly.
hi guys, could you please prepare script for given format ? 1,1,2,3,5,8,13,21,...etc use vbscript for this...?
Hi, Any one have the crack for QTP 10.0,if so could you please send it to phanijuly10@gmail.com
What is the best institute in Ameerpet? If people think Ameerpet is the pride of hyd they need to go to Delhi/Gurgaon/noida you can find the difference.
Can we record using all the modes in a single script? Explanation with example is appreciated
Explain roles and responsibilites of 2yrs Automation qtp engineer.
I want to open a Notepad window without recording a test and I do not want to use SystemUtil.Run command as well How do I do this?
In smart identification, explain about 1. Base filter properties 2. optional filter properties with examples?
Hi, I want to write the script for a webpage. But i didn't added the properties of the objects to the object repository. Without adding the object properties to the object repository, how to write the script. When i am writing the script, Let us say i typed as Browser (""). after selecting ".", if the object is added to the object repository it will display atomatically. But in my case it is not as i didn't added the object properties. How to proceed further in the above mentioned case to write the script manually. Pls let me know if you didn't understand the question.