what's the difference in between function and sub and give
some code as well
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / venkatesh
Hello every body,
If you don't know the rite example No issue...
But please don't copy and paste QTP user guide examples..
Humble request for all
Thanks
Venkatesh
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / rachel wang
Nothing wrong to post a correct answer in any ways.
Of course 'QTP Online Help' provides the better answer, I
always look up QTP first.
- Rachel
| Is This Answer Correct ? | 2 Yes | 0 No |
Which scripting language used by quicktest professional (qtp)?
Explain how Does Run time data (Parameterization) is handled in QTP?
What is quick test pro? What is a quick test professional?
Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site?
Define virtual object?
what is web application and client server application.is there any difference ?
what is the exact Diff. Between Test and Component in QTP?
How may types of defects identify application or your currently working application?pls give me answer..
I register user defined function in one test, I tried to call that function into other test. But that function not works in other test please give the direction for that.
Hi I know two types of testing processes. 1. Reaquirments stage,test design,code review's, Design review's, Test Plan, Test Cases design, test execution, Defect Reporting and tracking, UAT, Signoff. 2.Test Initiation , Test Plan, Test Design, Execution,Bug tracking, UAT, Sign off.
I AM NEW IN QTP,PLZ TELL ME ANY BOOKS FOR QTP, MY COMPANY IS QTP,SO I LEARN QTP,PLZ ANYBUDY HELP ME
Explain the keyword driven framework for the window based application complete creation of library files,env file,test data,recovery file,excel file ,repository etc and as a test engineer how is ur approach