Page 1 of 1

Size of a multidimensional array

Posted: Wed Apr 01, 2020 8:29 am
by zolysoftsolutions
Hi my friend.
How can i determine the size (the number of fields) of a multidimensional array?

example:

xarr:={ {a,1} , {b,1}, {c,1}}

the length (number of records) is ok with len(xarr) will return 3, but I need a funtion to determine the size (the fields) like requestedfuntion(xarr) to return 2

Thank you.

Re: Size of a multidimensional array

Posted: Wed Apr 01, 2020 8:54 am
by edk
It's simple:

Code: Select all

xarr:={ {a,1} , {b,1}, {c,1}}
FOR i = 1 TO Len ( xarr )
	MsgDebug (xarr [ i ], Len ( xarr [ i ] ) )
NEXT i 

Re: Size of a multidimensional array

Posted: Wed Apr 01, 2020 9:19 am
by zolysoftsolutions
Thank you for quick replay.

so..

Code: Select all

len(xarr[i])
returns the number of columns in row i.

Thank you very much