what is the difference between function and subroutine
....here every one knows theoretically...here my QUESTION IS
WHAT IS THE MEANING OF FUNCTION CAN RETURN A VALUE AND SUB
CAN NOT RETURN A VALUE .....WHAT DOE'S IT MEAN FUNCTION CAN
RETURN A VALUE HOW FUNCTION CAN AND SUB CAN'T ....GIVE A
EXAMPLE FOR BOTH ....HOW IT CAN AND CAN NOT...HELP ANDY ONE....
Answer / denis parker
Function - can return value (but not must) to the calling script
Function with argument and not return value
x = "10"
y = "12"
Call Addition_1(x, y)
Function Addition_1(x, y)
msgbox (x&y)
End Function
Function without argument and not return value
Call Addition_2()
Function Addition_2()
x = "10"
y = "12"
msgbox (x&y)
End Function
Function with argument and return value
x = "10"
y = "12"
z = Addition_1(x, y)
Msgbox z
Function Addition_1(x, y)
Addition_1 = (x&y)
End Function
Function without argument and return value
z = Addition_1()
Msgbox z
Function Addition_1()
x = "10"
y = "12"
Addition_1 = (x&y)
End Function
Subroutine - cannot return value to the calling script
Subroutine with argument and not return value
x = "10"
y = "12"
Call Addition_1(x, y)
Sub Addition_1(x, y)
msgbox (x&y)
End Sub
Subroutine without argument and not return value
Call Addition_2()
Sub Addition_2()
x = "10"
y = "12"
msgbox (x&y)
End Sub
| Is This Answer Correct ? | 1 Yes | 0 No |
How can you quit from Action.
For QTP Test Engineer, What is his contribution to the Project? Means, As as automation test engineer what is his role in the current project?
If I give some thousand tests to execute in two days what do you do?
i have .xls,.txt,.doc files are there (together). i want find only .xls file among them? how can we write function?
What is the difference between Datadriven and Parameterization?
What is the file extension of the code file & object repository file in QTP?
What is dynamic arrays
If our application contain one image while executing script application failed to show that image but you have to check that image by importing dynamically from other location... Can we use Check Points here on dynamically imported image?
How you can decide which type of object repository you have to use?
why we use check points , In qtp we use the any check points , what r they , when and why
If u don't have any Knowledge on perticular application but they give that application to u for Testing ? Then How we wil move towards testing on that application?
unique properties of button,edit box, radio button,check box?