This is how to write to a file
Dim fso, MyFile, AcctNo
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("c:\Accounts.txt", 8, True)
AcctNo= DataTable("accountNo", dtGlobalSheet)
to read from file use the above with changing 8 to 1 and MyFile.WriteLine to MyFile.ReadLine
by the way the above script is for writing the account number stored in the global sheet as an output parameter you need to tweak the script little bit
"I realize it's an error, but no one is going to try to do that!"
From "Top 10 Stupid Comments from Developers".
I am having trouble writing to a file in VB script and reading the info out to a file for a Quick Test Pro script.
I am basically working with a list of account numbers that I create in 1 script and I'd like to write the list of account numbers out to a file and then have another script grab the file and read those account numbers.
Any gurus have some insight.
I have been working with the following
Dim fso, MyFile
Where in the script do you place this coding segment?
There is also another conditional IF-THEN-ELSE-END IF loop in the script.
Does the coding segment that you mentioned have to be at the end of the script?
Let's talk offline, I'd probably benefit from it.
I can be emailed at firstname.lastname@example.org
The Creation of Object and the File opening can be done at the start of the script. Then the commands for Writing and the reading of lines to/from the file can be written as and how your script process. If you want that writing to file should done after checking some if condition then you can place that code within the if condition otherwise you can put it outside.
But make sure when you write to the file the data to be written should be available with you. and when you are reading the file the file should be open.