ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
what's the difference in between function and sub and give 
some code as well
 Question Submitted By :: Shicvani
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what's the difference in between function and sub and give some code as well
Answer
# 1
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 ?    5 Yes 0 No
Kamesh
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
what type of application we can select for automation testing and what is the entry criteria for automation  1
please tell me how to identify the index of the link in the web table .links are not constant.example i want to click the link in the inbox ,search the item and click the partcular mail.(mail links count is not constant)  1
We are calling Actions in Expert View by using Run Action.but i want to know where we are saving the Actions Scripts.Pls explain??  1
How to get data line by line from web element  1
How can we fill data in a text box without recording using object spy. Can you please provide the steps... TCS1
How to connect QTP to Testdirector Polaris4
What is BPT?  2
Hi What are re-usable actions in QTP? -Thank You Siemens3
Hi all, I am New to QTP . I am Now in critical situtaion. I want to know How to create our own object respository for our application. please say the answer with example.  3
How to record object in runtime. I am testing one Image website in which every time image change on home page.so if i records the image list but during running image get change, and QTP gives error  1
It is very difficult to test in manual for that we go to DATA DRIVEN TEST.  3
Hi,The question is write a script for the following scenario. scenario:in a job portal i entered QTP 3yrs testing then click search button.then it displays results like Test lead bangalore (here is a checkbox). Test lead hyderabad check box so on... question is if test lead position in bangalore then checkbox shld be enabled automatically.. Thatavarti-Technologies3
hi i want write code for "test engineer" in this i want write reverse how ca plz let me know through script  4
Hello, How can i capture first letter of any string using QTP. For ex.. i want "j" in the below string "john" could any one explain me? Is there any function for that? Livetek2
What is the Diff between Image check-point and Bit map Check point? CTS12
Other than using import sheet statement for importing the data from excel sheet, is there any other method that can be used?  2
Give me diffrent script in QTP for Webpage(Java and .Net),WindowsBased Applications,Java application,.Net application... Virtusa2
Does QTP work in UNIX environment BirlaSoft3
How to pass a variable in Dos Command using QTP? Eg: Dim path1, path2 path1 = "C:\Test\sample1.doc" path2 = "C:\Test\sample2.doc" How can we pass these path1 and path2 inside the "copy" dos command? I tried like this. this is not working. oShell.run "cmd /K copy" &path1 &path2  1
Can you expect major bugs in Net banking Application?  1
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com