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
Suppose I created one object as virtual object? That object is applicable to that test? Or all the tests?
In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer
what is run action?
What is the latest version of qtp?
what function you write to do database testing with the help of qtp?
How to make qtp understand the difference amongst the same type of objects .suppose there are 5 check boxes in a page and I have to choose the 2nd one, how to do that through script?
i have asked earlier only one question how to test web application using QTp plz send me the answer quickly
what is ODC and GDC?
In the Hybrid framework, data can access the database, excel file, XML etc. Is it true?
What is environment variable in qtp and why to use it?
what frame work you are following?
How can I use Call dlls in QTP ?
how will you load the test cases in ddt?
In a flight window we have to enter the name and meal request for every passenger.In that window if we give Total passengers=1 then the Psngr1 name field and psngr1 meal request field will reflects.if we give Total passengers=2 then Psngr1 name field and psngr1 meal request field,Psngr2 name field and psngr2 meal request field and so on. how we can handle this scenerio thru Descriptive programming?
What are the different recording modes and how do they work?