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 / 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 |
What is the latest version of QTP? aster googling i found it 9.5 . but somewhere in my frnds resume i hve seen 10.0 so i am a bit confused pls let me know.
What is the Dynamic Scenario in QTP? And also anybody give the example for this?
Can UFT be connected to Quality Center? If ‘Yes’ brief the process or steps.
Pls let me know how to find out creation time and index for the web application in descriptive programming?
What is the main difference between desriptive programming and generic functions
How to Parameterize Object repository in QTP?
how to test Web application using QTP software
How to use reporter.report event in qtp ?
Is it possible to test Flat file using QTP? I have two file- first file is Input file and second file is output file. Input file has Format like first 2 field is record type, next 10 field is Description. Output file also has format. I want to check this file format using QTP. Is it possible?? please reply with example.
How does QTP identify an object?
When Object Repository is available what is the necessity of having Descriptive programming which needs more scripting efforts.
how to test one edit box using dotnet addin for Web Applications? write script?