One cool thing about QTP is that you can create custom functions and then stored them in a function library so that all of your tests can call the custom functions stored in the function library.
Example of a Function:
Example of Associating a function with a function library.
First make sure you have a function library file created (this type of file ends in .qfl) Then in QTP Click File > Settings > Resources > Associate Function Library. Click green plus sign. Select The Function Library File. Click Okay.
Example Calling a Function: