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 |
Count the number of radio buttons and randomly select one.
hi friends i have 4 yrs exp in testing and 2 yrsexp in QTP.currently aim working in mnc in north as a permanent employer .iam looking for job in south is there any openings plz let me know my mail id is bjr@aol.in its very urjent
Define object spy ?
what is the framework followed by ur company in qtp
what is the syntax or command in vbscript to display user message example i want to display "welcome to QTP".
how to click on object? (with out knowing the object details) for ex: in a webpage one link is available.i want to click that link by using one menthod through qtp?
how can i call an external action,which is not added external action of an action?
Explain the check points in QTP?
22 Answers Gray Matrix, IBM, Microsoft, Prapan Solutions, Zensar,
how can we compare descriptive programing with a regular expression
we are submitting data one form to another form.defaultly it is time period set as 5sec. but it is taken 15sec what to do
what and how to answer for the question "tell me about yourself ?" for 3 years experience. can anyone say inj detail please... its urgent
How to enter table check points?