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 |
How to capture the tooltip of webelement,if there are two values displayed in tooltip of webelement?
In an interview, what r the general questions asked in SQL which is realted to testing ?pls give me anwser to this question?
How to execute the test cases using QTP. i.e What is the use of QTP while execution
If enter into interviewer room? how u introduce with him. with shakehand or waht?
What is test object model in QTP ?
What are the major/ important methods, functions in QTP we use realtime testing
what are the design objects in qtp
What is the exact difference bet function and action in QTP Anybody can explain it in detail..Thanks in advance..
I have made the recovery scenario in script. When i am exceuting the script. it stop automatically after running recovery scenario. Please tell the resaon?
How u execute test cases in manual testing?
My Project is HOSPITAL CONTROL SYSTEM. In this MY testing modules are In-patient and Out-patient. plz explain those modules. i.e. How explain to Interviewer. with full details also . Waht types of bugs we can fond ? NOTE : IT is a web project plz urgent.
Explain the concept of object repository and how quicktest professional (qtp) recognises objects?