Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] csv - v.toarray problem
#5
k. I tried doing that, but now the macro breaks after outputting "line1"

There's an error with this line "out a[r c]" near the bottom <-------- Error (RT) in reading csv - getting help in forum: invalid index. ?


Here's the code

Macro reading csv - getting help in forum
Code:
Copy      Help
str s ss
s=
;line1
;line2
;line3
;line4

s.setfile("$temp qm$\test.csv")
ICsv v._create
v.FromFile("$temp qm$\test.csv")


int nr=v.RowCount
int nc=v.ColumnCount
int r c
for r 0 nr
,;out "--- row %i ---" r    
,for c 0 nc
,,s=v.Cell(r c)
,,;out s

v.ToString(ss)
;out ss


;v.ToArray(ARRAY(str)*a)  Error in Macro:  ARRAY variable cannot be declared inline.

ARRAY(str) a.create(nc nr)

v.ToArray(a)

for r 0 nr
,;out "--- row %i ---" r    
,for c 0 nc
,,out a[r c]
,,;out s


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)