StructFindValue()
Searches recursively through a substructure of nested arrays, structures, and other elements for structures with values that match the search key in the value parameter.
StructFindValue( Top=struct, Key=string, Scope=string );
Returns: Array
Examples
Non-Member Function
animals = {
cow: {
noise: "moo",
size: "large"
},
pig: {
noise: "oink",
size: "medium"
},
cat: {
noise: "meow",
size: "small"
}
};
// Show all animals
Dump(
label: "All animals",
var: animals
);
// Find animal containing value of 'medium'
findMediumAnimal = StructFindValue(animals, "medium");
// Show results in findMediumAnimal
Dump(
label: "Results of StructFindValue(animals, ""medium"")",
var: findMediumAnimal
);
See also
- Structures
- struct.findValue()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)