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



can a Function return more than one value..??? if so please give me the code for that...

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

can a Function return more than one value..??? if so please give me the code for that...

Answer / prasad

Function alway returns one value. only action in QTP
returns more than one values.

Is This Answer Correct ?    3 Yes 0 No

can a Function return more than one value..??? if so please give me the code for that...

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

can a Function return more than one value..??? if so please give me the code for that...

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

can a Function return more than one value..??? if so please give me the code for that...

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

Post New Answer

More QTP Interview Questions

how are environment variables used in real time projects (testing)?what answer should be given about this in interview.need real time explanation breifly?thnx in advance.

2 Answers  


What is the basic concept of qtp?

0 Answers  


How to Install QTP on Citrix Environment? Possible send me the installation steps.. That would be great help

1 Answers  


Can we add the objects of an application dynamically?

2 Answers   KEN Group, LD College,


Explain in brief about the QTP Automation Object Model.

1 Answers   Crea,






1>why parameterization is necessary in qtp? 2>if we give constant value then what problem?

5 Answers   Wipro,


What is difference between Quality centre and Test Director?

1 Answers   Nokia,


Write a QTP script to print all the link names displayed in a web page

4 Answers   TCS, Virtusa,


how to connect qtp to sqlserver?(if any body know about this please send mail to me:sheik_feroz5@yahoo.com)thank u

3 Answers   Honeywell,


What is the use of Accessibility check point?

3 Answers  


Give one example of Standard checkpoint in qtp 10?

1 Answers  


Can we Script any test case with out having Object repository? or Using Object Repository is a must

3 Answers   Crea,


Categories