Hi Guys,
what is the correct syntax for printing a multidimensioan l array to a .txt file?
I know a simgle dimension array can be printed like this.
Print #1, arrCount(1);
Currently I am using the following code below to do it but this way I am not able set the delimiters and so unable to open in in excel with all data in different cell. I'm using comma as seen in the code but I want a better solution.
Before getting sidetracked, here is the question. How do you print a milti dimensioanl array to a file?
thanks guys
what is the correct syntax for printing a multidimensioan l array to a .txt file?
I know a simgle dimension array can be printed like this.
Print #1, arrCount(1);
Currently I am using the following code below to do it but this way I am not able set the delimiters and so unable to open in in excel with all data in different cell. I'm using comma as seen in the code but I want a better solution.
Before getting sidetracked, here is the question. How do you print a milti dimensioanl array to a file?
thanks guys
Code:
If Not blmFileOpen Then
Open "C:\Temp\MarketData\ArrayTest.txt" For Output As #1
'Print #1, arrCount(n, j);
Print #1, n + 1 & ",";
Print #1, arrCount(n, 0) & ",";
Print #1, arrCount(n, 1) & ",";
Print #1, arrCount(n, 2) & ",";
Print #1, arrCount(n, 3) & ",";
Print #1, arrCount(n, 4) & ",";
Print #1, arrCount(n, 5) & ",";
Print #1, arrCount(n, 6) & ",";
Print #1, arrCount(n, 7) & ",";
Print #1, arrCount(n, 8) & ",";
Print #1, arrCount(n, 9) & ",";
Print #1, arrCount(n, 10) & ",";
Print #1, arrCount(n, 11) & ",";
Print #1, arrCount(n, 12) & ",";
Print #1, arrCount(n, 13) & ",";
Print #1, arrCount(n, 14) & vbCrLf;
' n = n + 1
' j = j + 1
blmFileOpen = True
Close #1
Else
Open "C:\Temp\MarketData\ArrayTest.txt" For Append As #1
' Print #1, arrCount(n, j);
Print #1, n + 1 & ",";
Print #1, arrCount(n, 0) & ",";
Print #1, arrCount(n, 1) & ",";
Print #1, arrCount(n, 2) & ",";
Print #1, arrCount(n, 3) & ",";
Print #1, arrCount(n, 4) & ",";
Print #1, arrCount(n, 5) & ",";
Print #1, arrCount(n, 6) & ",";
Print #1, arrCount(n, 7) & ",";
Print #1, arrCount(n, 8) & ",";
Print #1, arrCount(n, 9) & ",";
Print #1, arrCount(n, 10) & ",";
Print #1, arrCount(n, 11) & ",";
Print #1, arrCount(n, 12) & ",";
Print #1, arrCount(n, 13) & ",";
Print #1, arrCount(n, 14) & vbCrLf;
'n = n + 1
' j = j + 1
Close #1
End If
Comment