kdjonesmtb2
Technical User
Vbscript file runs but text file is not generated
I am using a Windows 7 Machine with Service pack 1
Where can I put some displays in to validate that the file is created?
Also I would like to use a DataTable to rather than txt
Would the code below work?
"dim x
x=DataTable.Value("sample_text",DTGlobalSheet)
tf.WriteLine($x$)"
This code executes but the file is not created
Sub CreateFile()
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.
CreateTextFile("\\ikanas267\Documents\kgittensjones\My Documents\QTP Test 834\Text files\testfile.txt", True)
print tf
' Write a line with a newline character.
tf.WriteLine("Testing 1, 2, 3.")
' Write three newline characters to the file.
tf.WriteBlankLines(3)
' Write a line.
tf.Write ("This is a test.")
tf.Close
End Sub
I am using a Windows 7 Machine with Service pack 1
Where can I put some displays in to validate that the file is created?
Also I would like to use a DataTable to rather than txt
Would the code below work?
"dim x
x=DataTable.Value("sample_text",DTGlobalSheet)
tf.WriteLine($x$)"
This code executes but the file is not created
Sub CreateFile()
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.
CreateTextFile("\\ikanas267\Documents\kgittensjones\My Documents\QTP Test 834\Text files\testfile.txt", True)
print tf
' Write a line with a newline character.
tf.WriteLine("Testing 1, 2, 3.")
' Write three newline characters to the file.
tf.WriteBlankLines(3)
' Write a line.
tf.Write ("This is a test.")
tf.Close
End Sub