emptying array contents

  • Thread starter Thread starter craig
  • Start date Start date
C

craig

I am wondering what the syntax would be to dump the
contents of an array out into a text file

what would be better would be to dump the contents of the
array into an MS Excel file and skip to the next row
everytime a particular character occurs in the array.

if anyone knows how to do this, please let me know.

thanks

Craig
 
Craig,

here's some example code on the text file case:

Dim MyArray(n)
....
'code which assigns values to the array
....
Open "C:\SomeFolder\SomeFileName.txt" For Output As #1
For i = 0 to n 'n being the array size
Print #1, MyArray(i)
Next
Close #1

This code will overwrite the text file each time it's run. If you want to
append to the ned of the file instead, use:
Open "C:\SomeFolder\SomeFileName.txt" For Append As #1

HTH,
Nikos
 
Back
Top