Actually running this program several time shows that the contents of the file 
never change. I'm really confused. The value of count is 1(one) so only one 
record should be there.

--- In [email protected], "georgeewalters" <gwalt...@...> wrote:
>
> Here is the code:
> 
>       outName = "\Documents and Settings\AcuTrack\StockCount.txt"
> 
>       Set outFile = fs.CreateFile(outName, 4096)'--Create and open and
>       Set file2   = fs.OpenFile(outName)
>       For i = 1 To count
>       tmp = list(i,0) & list(i,1) & list(i,2) & list(i,3)
>           MsgBox tmp
>           file2.WriteText tmp
>     Next
>     
>     file2.Close
>     
>     MsgBox("File saved")
> 
> My understanding is the CreateFile with 4096 will delete the file if it 
> exists and create a new empty file. I then write one record to the file and 
> when I look at the file with fileExplorer (on PDA i'm talking) it has the 
> record I wrote but at end of all the other records. So the createfile did not 
> delete the file. Can someone explain? I must be understanding something wrong 
> or a mistake in the code above.
> 
> Flags are: 
> 
> 0 - Fail if file already exists (default) 
> 4096 - If file exists, delete and recreate
>


-- 
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en.

Reply via email to