Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



how can we return a value from userdefined function for eg 2 functions in func1 iam getting 2 value..

Answer / 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

More QTP Interview Questions

how did u use automating testing tools in ur job?

0 Answers  


what is run-time object in qtp? explain with example?

2 Answers  


what are the different data driven types?

6 Answers  


How do u write a regular expression for date (dd/mm/yyyy) field?

10 Answers  


how we connect 1. qtp9.2 to the quality center9.0? 2. Load runner8.0 to the quality center9.0

0 Answers  


Today only i joined in this site. Can u please tell me definition of parameterization. and how i can do the parameterization?

4 Answers  


Can you write User defined function for WebEdit ? Note1: This function can be used for all web edits in all pages Note2: Don't use Child objects method

1 Answers   IBM,


You will receive the mail in your outlook from client at night time to go ahead for the execution. Based on the mail you need to trigger the batch run. What is the QTP Code for this?

0 Answers   CTS,


How many tabs are available in debug viewer pane?

0 Answers  


How to associate function library at a run time?

0 Answers  


How u perform exception handling in QTp,what is other name for ths

1 Answers   Lehman Brothers,


Explain me in deatail about DATADRIVEN framework including scripts ?(realtimes plz)(Chandana)

4 Answers   Wipro,


Categories