There are a few different things I've used before. One is the FileSystemObject, and the other is the Print command in QTP:
'Create the FileSystemObject
Set FSO = CreateObject(''Scripting.FileSystemObject'')
'Create a text file to write to. If it already exists, overwrite it (True)
Set My_File = FSO.CreateTextFile(''C:'', True)
'Now that the file is created, it is ready for input. Insert the following statement at any point in your script to write to the status file:
'If you need to write variables or other data to the file, just concatenate it to the string, such as:
My_File.WriteLine ''Testing username: '' & var_userName & '' and ID#: '' & var_ID
'When finished, close the file and destroy the FileSystemObject
Set My_File = Nothing
Set FSO = Nothing
Another alternative would be to use the obscure Print command in QTP. This will pop open a dialog box (Print Log) that you can use if you want to be able to check status messages that you log as the script is running. It doesn't require creating objects or anything, and is simply a Print command in QTP, followed by a string value that can be any text you want, similar to the WriteLine method above:
Print ''Testing the login functionality''
Print ''Using username: '' & var_userName & '' for this iteration''