Hi Guys,
I've been trying to get saveCSV to work with a list of arrays & all i seem to get is the last array repeated for each of the items in the list... I've shortened my code down to the following in an attempt to get it working...
(I'm having to retype this as the program cant be ported to this PC - foregive typos cheers!)
MyFile & MyFolder defined elsewhere work as required
Dim Savelist as list
Dim export as stringutils
Dim Headers(9)
Dim row(9)
Dim x,y as int
Savelist.initialize
Headers= Array as string("col1",col2"....,"col9")
SaveList.clear
For y = 0 to 10
for x = 0 to 8
row(x) = y & "-" & x
next
savelist.add(row)
next
export.saveCSV2(MyFolder,MyFile & ".csv",",",Savelist,Headers)
The file is written but the contents are something like :-
Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
I was hoping for :-
Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9
0-0,0-1,0-2,0-3,0-4,0-5,0-6,0-7,0-8
1-0,1-1,1-2,1-3,1-4,1-5,1-6,1-7,1-8
2-0,2-1,2-2,2-3,2-4,2-5,2-6,2-7,2-8
3-0,3-1,3-2,3-3,3-4,3-5,3-6,3-7,3-8
.....
10-0,10-1,10-2,10-3,10-4,10-5,10-6,10-7,10-8
Where am I going wrong??? :sign0085:
I've been trying to get saveCSV to work with a list of arrays & all i seem to get is the last array repeated for each of the items in the list... I've shortened my code down to the following in an attempt to get it working...
(I'm having to retype this as the program cant be ported to this PC - foregive typos cheers!)
MyFile & MyFolder defined elsewhere work as required
Dim Savelist as list
Dim export as stringutils
Dim Headers(9)
Dim row(9)
Dim x,y as int
Savelist.initialize
Headers= Array as string("col1",col2"....,"col9")
SaveList.clear
For y = 0 to 10
for x = 0 to 8
row(x) = y & "-" & x
next
savelist.add(row)
next
export.saveCSV2(MyFolder,MyFile & ".csv",",",Savelist,Headers)
The file is written but the contents are something like :-
Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
10-0,10-1,10-2,10,3,10-4,10-5,10-6,10-7,10-8
I was hoping for :-
Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9
0-0,0-1,0-2,0-3,0-4,0-5,0-6,0-7,0-8
1-0,1-1,1-2,1-3,1-4,1-5,1-6,1-7,1-8
2-0,2-1,2-2,2-3,2-4,2-5,2-6,2-7,2-8
3-0,3-1,3-2,3-3,3-4,3-5,3-6,3-7,3-8
.....
10-0,10-1,10-2,10-3,10-4,10-5,10-6,10-7,10-8
Where am I going wrong??? :sign0085: