File:  [parser3project] / parser3 / tests / 129.html
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Fri Aug 17 10:51:43 2007 UTC (19 years ago) by misha
Branches: MAIN
CVS tags: release_3_2_3, release_3_2_2, HEAD
- tests for ^table.hash[...][$.type[string|hash|table]] added

@main[]
$table[^table::create{group	name
first	a
first	b
second	c
third	d
third	e
}]


<b>^$.distinct[tables]</b><br />
^print[^table.hash[group][
	$.distinct[tables]
]]


<hr />
<b>^$.distinct(1) ^$.type[table]</b><br />
^print[^table.hash[group][
	$.distinct(1)
	$.type[table]
]]


<hr />
<b>^$.distinct(1) ^$.type[hash]</b><br />
^print[^table.hash[group][
	$.distinct(1)
	$.type[hash]
]]


<hr />
<b>^$.distinct(1) ^$.type[string]</b><br />
^try{
	^print[^table.hash[group][
		$.distinct(1)
		$.type[string]
	]]
}{
	^if($exception.type eq parser.runtime){
		failed, that's OK.
		<br />with ^$.type[string] only one field must be specified
		$exception.handled(1)
	}
}


<hr />
<b>^$.distinct(1) ^$.type[string]</b><br />
^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"){<blockquote>^print[$value]</blockquote>}}}<br />
}

E-mail: