Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using large lists or arrays in QM
#3
Yes, QM does not have array initializers. Can be used CSV.

Function InitArray_int_2D
Code:
Copy      Help
;/
function $csv ARRAY(int)&a

;Creates ARRAY(int) of 2 dimensions (columns, rows) from a CSV string.

;EXAMPLE
;str csv=
;;1,2,  3,4
;;5,6,  7,8
;;9,10,  11,12
;;13,14,  15,16
;ARRAY(int) a
;InitArray_int_2D csv a
;
;;results
;int row
;for row 0 a.len
,;out F"{a[0 row]},{a[1 row]},  {a[2 row]},{a[3 row]}"


ICsv c._create
c.FromString(csv)
a.create(c.ColumnCount c.RowCount)
int i j
for i 0 a.len
,for j 0 a.len(1)
,,a[j i]=c.CellInt(i j)


Messages In This Thread
Using large lists or arrays in QM - by ohalligan - 09-17-2021, 09:28 PM
RE: Using large lists or arrays in QM - by Gintaras - 09-18-2021, 05:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)