<?php
function fn_between_tcc($aql)
{
	$data = $aql->Consume(3);
	
	//print_r($data);
	
	$thresha = $data[0]->value;
	if (is_array($thresha))
	{
		$thresha = $thresha[0];
	}
	
	$threshb = $data[1]->value;
	if (is_array($threshb))
	{
		$threshb = $threshb[0];
	}
	
	if (count($data[2]->value) == 0)
	{
		$a = new AQLStackElement();
		$a->typename = "pointlist";
		$a->islist = true;
		$a->value = array();
		array_push($aql->stack,$a);
		return;
	}
	
	if ($data[2]->value[0]->value == "")
	{
		LiveValuesForPoints($data[2]->value);		
	}
	
	$hitlist = array();	
	foreach($data[2]->value as $pnt)
	{
		if ($pnt->rawvalue > $thresha)
		{
			if ($pnt->rawvalue < $threshb)
				$hitlist[] = $pnt;
		}
	}
	
	//print_r($hitlist);
	
	$a = new AQLStackElement();
	$a->typename = "pointlist";
	$a->islist = true;
	$a->value = $hitlist;
	array_push($aql->stack,$a);

}
?>