You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently our extraction functions accept scalar indices: each is either a numeric position or a textual key. They also return a single Variant.
Dim i AsVariant: i = Array(3, "field_1", 5)
Index x, i
However, we might define an IndexAll() which accepts an array (or even Collection) of scalars as a valid index. When IndexAll() encounters this index, it iterates over each scalar and indexes deeper from there, and finally it returns (say) a Collection with all the results.
Warning
This will be tricky with multidimensional arrays, where such an index must somehow iterate over a particular dimension of that array.
This let us programmatically extract a set of values. For example, this call should yield $2 \times 1 \times 3 = 6$ results.
i = Array( _
Array(3, 4), _"field_1", _
Array(5, "subfield_2", 7) _
)
IndexAll x, i
We might also permit the scalar True as an index, which tells IndexAll() to iterate over all elements in the current structure, rather than an explicit subset of its elements as specified by an array.
i = Array( _
Array(3, 4), _"field_1", _True_
)
IndexAll x, i
Currently our extraction functions accept scalar indices: each is either a numeric position or a textual key. They also return a single
Variant.However, we might define an
IndexAll()which accepts an array (or evenCollection) of scalars as a valid index. WhenIndexAll()encounters this index, it iterates over each scalar and indexes deeper from there, and finally it returns (say) aCollectionwith all the results.Warning
This will be tricky with multidimensional arrays, where such an index must somehow iterate over a particular dimension of that array.
This let us programmatically extract a set of values. For example, this call should yield$2 \times 1 \times 3 = 6$ results.
We might also permit the scalar
Trueas an index, which tellsIndexAll()to iterate over all elements in the current structure, rather than an explicit subset of its elements as specified by an array.