Size of a multidimensional array

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
zolysoftsolutions
Posts: 139
Joined: Wed Feb 29, 2012 3:33 am
Location: Gyulakuta, Erdélyország
Contact:

Size of a multidimensional array

Post 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.
_______________________________
Open eyes for you!
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Size of a multidimensional array

Post 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 
User avatar
zolysoftsolutions
Posts: 139
Joined: Wed Feb 29, 2012 3:33 am
Location: Gyulakuta, Erdélyország
Contact:

Re: Size of a multidimensional array

Post 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
_______________________________
Open eyes for you!
Post Reply