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 |
Does QTP run in any environment?
the question was on what techonlogy u been working on i said VB then he asked me the addin for VB in Qtp?
QTP is not displaying in OBJECT SELECTION-CHECKPOINT PROPERTIES boxs only WINDOW AND WIN OBJECT remaining pages and links , images not displaying in web application testing. how can I get the pages and links in object selection? Please anyone tell me?
How to run a test using quicktest professional?
A webPage has a ComboBox with 10 values in it. Write a script to select 4 vales from it using CTRL key
How you can find length of array in qtp?
how to write the descriptive programming in QTP for loginwindow.without using Step generator,object repository for referecnes
How we can call the scripit from another scripit in QTP?,Not a call Action
What are the challenges u faced in testing with crm domain? How u overcome with?
how to invoke the web application through script in qtp
what is the use of Text output value in Qtp?
In an(AUT) web application their are two frames as fraMain and fraFooter. Both the frames contain link which needs to be retrieved at a single step. I tried it using "Regular Expression" as fra.* but QTP doesn't recognize the object. So Plz help me out to get resolve the problem:-)