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 Posted / 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 |
Post New Answer View All Answers
Explain how Does Run time data (Parameterization) is handled in QTP?
what could go wrong with test automation?
i have a doubt can anyone tell me where are scripts stored while using QTP.Tell me the exact procedure takes place in real time?like how we call scripts how to proceed after writing scripts?how scripts are executed etc?i heard some use Qc whether others dont use.so tell me whole procedure for both the things it will be a very big help.as i have interview i want to have whole idea on this.its very urgent.
How can you handle exceptions in qtp?
Please Don't mind .i want in detail the real time process i.e in each document what it contains.
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?
How to analyzing the checpoint results?
what is stepin & stepout?
Explain advantages and disadvantages kdf?
how will you check how many members visited the website www.infosys.com?
how to find that tools work well with your existing system?
What is fragmentation and paging?
How reliable are the site's Internet connections required to be? And how does that affect backup system or redundant connection requirements and testing?
To retrive the test data which tool vl use and whats basis u vl write test data? its urgent
hi guys we r working in office...we write some scripts..suddenly we have a work(5min only) in out side..what will do now,,,used to system shut down or log off or lock or sleep mode,switch use or hibernate?