We can write user define functions in QTP Editor or in notepad also. when we write funtions in notepad we have to save file with .vbs extention. and close notepad then we can use that file in qtp resources. in resources we give notepad file path. than we can use funtion directly by functions name....

1 User has rated as useful.
Login to rate this answer.
Using QuickTest, you can define and store your user-defined functions either in a function library (saved as a .qfl file, by default) or directly in an action within a test. A function library is a Visual Basic script containing VBscript functions, subroutines, modules, and so forth. You can also use QuickTest to modify and debug any existing function libraries (such as .vbs or .txt files).
When you store a function in a function library and associate the function library with a test, the test can call the public functions in that function library. Functions that are stored in an associated function library can be accessed from the Step Generator (for tests and function libraries) and the Operation column in the Keyword View, as well as being entered manually in the Expert View.
When you store a function in a test action, it can be called only from within that action—the function cannot be called from any other action or test. This is useful if you do not want the function to be available outside of a specific action.
You can also define private functions and store them in a function library. Private functions are functions that can be called only by other functions within the same function library. This is useful if you to reuse segments of code in your public functions.

3 Users have rated as useful.
Login to rate this answer.
user defined functions are the functions defined/designed by the user for re-usability. to create a UDF first write the function in qtp(to avoid syntax mistakes) then copy , past the same in Note Pad and save the file with .vbs extension. Now to associate it in qtp, go to-file-settings-resources-click on + button and browse the .vbs file-click apply-click "ok".
Login to rate this answer.
chenna
Answered On : Sep 8th, 2011
function name of the function
list of the statements
.
.
.
.
end function
Login to rate this answer.