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 reusable action and how the same can be implemented (process)?
How QTP support all types of applications (platforms)?
How to Parameterize Object repository in QTP?
images are dynamically changes how to compare two images with out using the bitmap
How to Display last item of a Combobox by using QTP?
Write a function which returns the addition of two numbers. give the value of the numbers outside the function.
What is the another extention name of library file.If that is exist than what's the differnce between them.
How can i click on any Excel sheet's "H" column with out writing coordinates Ex:Window("Book1").WinObject("Book1").Click 498,14 I dont want to give coordinates like 498,14 Can i open "H" column by writing like Ex:Window("Book1").WinObject("Book1").Click "H" or Ex:Window("Book1").WinObject("Book1").Click "H","1" or Ex:Window("Book1").WinObject("Book1").Click H,1 If i want to click on "Sheet3" of an excel sheet, Can i open like Ex:Window("Book1").WinObject("Book1").Click "Sheet3" Please help me any one
what is Smart identification
how do close the task manager through QTP?
What are the different types of action?
why require regression testing?