QTP can use 3 different types of function library extensions: .qfl (not .qfi), .vbs and .txt
.qfl is local to QTP and can only be called and used by QTP. .vbs and .txt on the other hand can be used by QTP and by any application other than QTP. So, what I am trying to say is that, you can open notepad and write a function and associate it with your test as a .txt file. Either way, all three can be used as QTP function libraries which contain a function that you can use in your test. Another way to use functions is to directly type them in your respective action. There is a difference between the .qfl and .vbs file. The difference is you can put a breakpoint in .qfl and debug your function written in the .qfl file. But, you cannot do this in a .vbs file. Because of this reason, I prefer writing function libraries in .qfl rather than in .vbs.