what's the difference in between function and sub and give
some code as well
Answer Posted / kamesh
A Function procedure is a series of VBScript statements
enclosed by the Function and End Function statements. A
Function procedure is similar to a Sub procedure, but can
also return a value. A Function procedure can take arguments
a Function procedure has no arguments, its Function
statement must include an empty set of parentheses.
Function Celsius(fDegrees)
Celsius = (fDegrees - 32) * 5 / 9
End Function
A Sub procedure is a series of VBScript statements
(enclosed by Sub and End Sub statements) that perform
actions but don't return a value. A Sub procedure can take
arguments (constants, variables, or expressions that are
passed by a calling procedure). If a Sub procedure has no
arguments, its Sub statement must include an empty set of
parentheses ().
Sub ConvertTemp()
temp = InputBox("Please enter the temperature in degrees
F.", 1)
MsgBox "The temperature is " & Celsius(temp) & " degrees
C."
End Sub
Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
how to disable the pop ups through QTP using a script
Describe synchronization point.
What is meant by Step generator?what is the use of this? we have 3 steps know there what r all those.? can u all pls give me clear idea of this
am not having intrest in coding lang like c c++ java etc can i choose Testing tools as my carrier and please suggest me which tool is good (suitable for me)
Discuss quicktest professional (qtp) environment?
What is the framework your company is following. What is the reason. Explain why key word driven frame work is chosen.
please any one can explain the keyword driven framework. with gmail example.
Mention the different actions types of qtp.
How is recording done when a application is over lapping the QTP application it gives a message object not recorded
How to release all resources file from the QTP?
Explain the terms test and business component?
In an interview, what r the general questions asked in SQL which is realted to testing ?pls give me anwser to this question?
Difference between copy to action and call to action?
How to define array in qtp?
In qtp is it possible to check broken links of a page?