@main[]
$table[^table::create{group name
first a
first b
second c
third d
third e
}]
^$.distinct[tables]
^print[^table.hash[group][
$.distinct[tables]
]]
^$.distinct(1) ^$.type[table]
^print[^table.hash[group][
$.distinct(1)
$.type[table]
]]
^$.distinct(1) ^$.type[hash]
^print[^table.hash[group][
$.distinct(1)
$.type[hash]
]]
^$.distinct(1) ^$.type[string]
^try{
^print[^table.hash[group][
$.distinct(1)
$.type[string]
]]
}{
^if($exception.type eq parser.runtime){
failed, that's OK.
with ^$.type[string] only one field must be specified
$exception.handled(1)
}
}
^$.distinct(1) ^$.type[string]
^print[^table.hash[group;name][
$.distinct(1)
$.type[string]
]]
@print[hData][sKey;value]
^hData.foreach[sKey;value]{
$sKey ^if($value is "table"){^value.menu{$value.name}[,]}{^if($value is "string"){$value}{^if($value is "hash"){^print[$value]
}}}
}