emptying array contents

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
 
N

Nikos Yannacopoulos

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top