in VBS there are 2 things (Function and Sub)
here is how to use a function, and using a Sub is similar.
1- Open the Notepad and paste the below
2- save the file as .VBS (note: change the save as file to All files inorder to save as .vbs)
3- open QTP and go to Test Settings menu
in QTP8.2 you will find it under Test , in QTP9.0 under File.
4- in the Test Settings pan click on the Resources tab and add the VBS file you created in step 2
5- now you can use your function in QTP
msgbox myValue 'will print out 3
hope this help.
"I realize it's an error, but no one is going to try to do that!"
From "Top 10 Stupid Comments from Developers".