Posts: 197
 
	
	
		Hi,
	
	
	
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		ToArray(ARRAY(str)*a) is declaration, not example.
	
	
	
	
 
 
	
	
	
		
	Posts: 197
 
	
	
		Here you go,
Please rename the attachment to test.csv. The attachment uploader won't let me upload csv.
str s ss
Attached Files test.zip  (Size: 550 bytes / Downloads: 516)
 
	
	
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		For testing please use string, not file. Example:
	
	
	
	
 
 
	
	
	
		
	Posts: 197
 
	
	
		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  str  s ss= ;line1 ;line2 ;line3 ;line4 setfile ( "$temp qm$\test.csv" ) ICsv  v._create FromFile ( "$temp qm$\test.csv" ) int  nr= v.RowCount int  nc= v.ColumnCount int  r cfor  r 0  nr, ;out "--- row %i ---" r     , for  c 0  nc,, s= v.Cell ( r c) ,, ;out s ToString ( ss) ;out ss ;v.ToArray(ARRAY(str)*a)  Error in Macro:  ARRAY variable cannot be declared inline. ARRAY ( str )  a.create ( nc nr) ToArray ( a) for  r 0  nr, ;out "--- row %i ---" r     , for  c 0  nc,, out  a[r c],, ;out s 
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		replace
out a[r c]
to
out a[c r]
In 2-dim arrays, the last dimension usually is for rows.
I'll add this note to ToArray help.
Macro 
Macro2209  out str  s ss= ;line1 ;line2 ;line3 ;line4 setfile ( "$temp qm$\test.csv" ) ICsv  v._create FromFile ( "$temp qm$\test.csv" ) ARRAY ( str )  aToArray ( a) int  r cfor  r 0  a.len , ;out "--- row %i ---" r , for  c 0  a.len ( 1 ) ,, out  a[c r];or for  r 0  a.len , out  a[0  r]
 
 
	
	
	
		
	Posts: 197
 
	
	
		Thank you!