LookupAll
Looks up a value in a search set and returns all of the corresponding values (with the same Index) in a set of results.
Syntax
LookupAll(element, search_set, results_set[, mode])RechercheTous(element, search_set, results_set[, mode])
search_set = the set of elements on which to run the search
results_set = the set of results returned, based on the search
mode = specifies the matching mode for the search (Qubes 10.0)
Remarks
Both of these sets can be either lists (see List), or else ranges, columns, rows or blocks. Normally, both sets should have the same size.
If results_set is smaller, and the search element falls outside of it, the function will return an empty value for each occurrence.
To only retrieve the first result for element, use Lookup.
With Qubes 10.0 an optional mode parameter is supported:
- 0 : performs a search on an exact case-sensitive match of the string value (this is the default)
- 1 : performs a pattern search, with element specifying the pattern, wildcards '?' for any single characters, and '*' for any number of characters are supported. The pattern matching is case insensitive.
- other values for mode are reserved for future use and have undetermined behavior
The element parameter being an array is support in Qubes 10.0 version after 2024.03, previously this would just return in either no match or an error.
Examples
LookupAll("a", List("a", "b", "a"), List("alpha", "beta", "alpha2")) = { "alpha", "alpha2" }
LookupAll( List(1, 3, 6) ,
List(0, 1, 1, 2, 3, 5, 8, 13, 21, 34),
List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) )
= List(1, 2, 4) // as 1 is at index 1 & 2, 3 is at index 4, and 6 is not present