R rkxo Active Member Licensed User Longtime User May 5, 2020 #1 Hi, How i get specific value direct from multi- dimetional array value? For example I have B4X: Copy array (0) -->(0) value1 (1)value 2 array (1) -->(0) value1 (1)value 2 How i get (value 2) from (array1) .In list only can get array but not in sub values B4X: Copy dim Values as list for i=0 to 3 values.add(Array As String(value1, value2)) next ' get values? array 1 value2? values.get(???) Thanks
Hi, How i get specific value direct from multi- dimetional array value? For example I have B4X: Copy array (0) -->(0) value1 (1)value 2 array (1) -->(0) value1 (1)value 2 How i get (value 2) from (array1) .In list only can get array but not in sub values B4X: Copy dim Values as list for i=0 to 3 values.add(Array As String(value1, value2)) next ' get values? array 1 value2? values.get(???) Thanks
stevel05 Expert Licensed User Longtime User May 5, 2020 #2 There is no way to tell in advance what type of data a List holds, it could be anything. You need to cast the object to the correct type first then read the values. B4X: Copy Dim StrArr() as String = values.get(0) For each S As String In Strarr Log(S) Next 'Or Log(StrArr(0)) Log(StrArr(1)) 'etc. Upvote 0
There is no way to tell in advance what type of data a List holds, it could be anything. You need to cast the object to the correct type first then read the values. B4X: Copy Dim StrArr() as String = values.get(0) For each S As String In Strarr Log(S) Next 'Or Log(StrArr(0)) Log(StrArr(1)) 'etc.