how can we return a value from userdefined function for eg 2
functions in func1 iam getting 2 values(a,b) and storing in
var(C). now i want to pass that var(c) to another func2 give
me the script

Answer Posted / nath t

Function returns only one value. when we assign the final
value with variable that name should be the same name of
the function name.

In the given example, som is the function it returns the
sum of two values when we assign that value to variable[i.e
same as function name(example: som = c)]

if you don't assign, function doesn't return any value
(example: z = c)

Example:

Function som(a, b)
c = a + b
som = c '(instead of these two step we can write in single
step like som = a + b)
End Function

x = 10 + som(10, 20)
msgbox x

you can pass this value in any other function.

Example:
y = som(som(10, 20), x)

msgbox y

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to replay a script in qtp?

612


How will you find the current time of the remote machine using QTP script?

593


Differentiate the type of test cases which can be automated and which cannot be automated?

565


what is the hierarchy to use properties in descriptive programming

1496


Explain about the quicktest professional (qtp) automation object model?

562






How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?

694


What is quicktest professional window?

555


Limitations in QTP?

1737


How QTP support all types of applications (platforms)?

4074


In QA Testing when do you use Loadrunner vs QTP? What are the main differences between those two tools? Explain the purpose with real world scenario examples...In advance thank you!!!

2379


www.icici.com ,after this.. home page wll came, in this page what r the items we r going to test for manual and what are items we r going to test for QTP... explian clearly with example

1726


suppose i login into gmail page after that i read all the messages (say 10 messages) i have to send (SAVE) the messages in Html,notepad and i have to replay(Compose) send the messages please give me the code and give mail id so that i can clear my question

1486


How to find the length of the string in qtp?

576


can any one say that where we can download the QTP trail version ??????????

1358


I have developed and executed a script successfully, and saved the same to QC. When I tried to execute the script from QC, the script is not executing. What are the possible reasons?”

583