11.62 values()
This function returns a list of all values in a collection. Default values are not included. Applied to a scalar value, this is returned as a list.
Definition
anyvalue values
(
anyvalue Value input
)
Parameters
- anyvalue Value input
- This parameter specifies the value on which the function is applied.
Return value
A list containing all values of a collection without the default values.
For a scalar parameter, a list containing only this parameter is returned.
Example
dialog D
on dialog start
{
variable hash DomainHash := [
".de" => "germany",
".us" => "usa",
".fr" => "france",
".uk" => "united kingdom" ];
variable string Country;
/* print all country names from the DomainHash */
foreach Country in values(DomainHash) do
print Country;
endfor
exit();
}
Output
"germany" "france" "united kingdom" "usa"
See also
Method :index()
C