GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 580 of 674    Print  
QTP Functions
how we can return a value from a function in qtp


  
Total Answers and Comments: 4 Last Update: April 27, 2009     Asked by: pvinilkumar 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 18, 2007 14:18:39   #1  
Anshoo_Arora Member Since: October 2007   Contribution: 384    

RE: QTP Functions
Function QTP(X Y)
' some code
End Function

If You call QTP from within another Function/Sub
Then
Call QTP(X Y)
else
QTP(X Y)
End If

 
Is this answer useful? Yes | No
December 18, 2007 16:27:02   #2  
hal9000 Member Since: December 2007   Contribution: 1    

RE: QTP Functions
Hi

To call a function we need to prepare the function in the function library
for eg: This is the function you prepared in the library :
function mywebinvoke()
systemutil.run "iexplore" www.yahoo.com
end function

Now to call this function go to the test in qtp and type

mywebinvoke()

it will directly go yahoo page.



 
Is this answer useful? Yes | No
December 20, 2007 20:17:09   #3  
anitamittal Member Since: December 2007   Contribution: 1    

RE: QTP Functions
temp ABC()
msgbox temp

Function ABC()
ABC "as"
End Function

You have to return the value using the function name as variable. Hope it helps!

Thanks
Anita

 
Is this answer useful? Yes | No
April 27, 2009 12:39:26   #4  
firozshaik27 Member Since: April 2009   Contribution: 2    

RE: QTP Functions
Suppose if we write a function as follows:

Public function Sum (parameter1 .......)
a 10
b 10
c a + b
msgbox c
Sum c
End Function

Always one thing make sure that whatever the value you return for ex c should point to the function name. In this case Sum is the function name.

I think this will work.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape