Hi all,
{1,2,3,8,9,9,9,9,9,80,90,70}, {56,76,54,32}, {20,23,45,54,32,54}, {1,2,3,4,5,6,7}, {11,12,13,14,15,16,17,18} Please suggest how do this using foreach function get output like this,
length of array 1 is 12length of array 2 is 4length of array 3 is 6length of array 4 is 7length of array 5 is 8
Thank You In Advance
Discussion posts and replies are publicly visible
One more solution I found to this problem is using merge() function. The code is attached below.
a!localVariables( local!arr: merge( { 1, 2, 3, 8, 9, 9, 9, 9, 9, 80, 90, 70 }, { 56, 76, 54, 32 }, { 20, 23, 45, 54, 32, 54 }, { 1, 2, 3, 4, 5, 6, 7 }, { 11, 12, 13, 14, 15, 16, 17, 18 } ), local!size: { a!forEach( items: local!arr[1], expression: a!localVariables( local!temp: fv!index, a!forEach( items: enumerate(length(local!arr)) + 1, expression: if( a!isNullOrEmpty(local!arr[fv!item][local!temp]), 0, 1 ) ) ) ) }, a!forEach( items: local!size, expression: "length of array " & fv!index & " is " & sum(fv!item) ) )