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 |
hi i want license key for qtp 9.2 pls its adjust product name : quick test professional locking code :8 - 54A6A license type : seat license maintenance number : 88888888-8888 pls send license key to my email id borusu.ramkumar@gmail.com
What is parameterization? What is syncronization pt.?
3 Answers Semantic Space, SRM,
how qtp identify two objects having same name, supose objects are in same page also with same name,specify spl feature.
i ve an excel in a QC folder. Thru my QTP script i want to open that excel in runtime. I am running this script from QC itself
how to automate standalone infopath forms using QTP? (it is not a dotnet or a web form)
how to call a funtion in a script? i have saved the login scipt in notepad. with extension .vbs. But when i am calling the function with the keyword CALL <Function Name>. its not working out. can any one give me a clue how to call the external functions. with example.
How many scripts do you write per day. What is the average number of scripts you have written in your recent project
1 Answers CenturyLink, Optum, Value Labs,
How can i check elements sorted in dorpdown using qtp..
Explain the Different types of QTP test assets and their extensions?
If there are 100 checkboes in a page then how can we select all chexkboxes at once through descriptive programing in QTP using vb script. Please send the answers...
how will we run batch tests in qtp what is the process to run the multiple test sets?
What are the difference between QTP and Winrunner