//
define array $a 10;
PROC main;
	xhp = new Hash(4,10,0,1);
	$1 = xhp.store('ABCD','X123');
	$2 = xhp.store('XYZZ',100);
	$3 = xhp.store(10,100);
	print xhp $1 $2 $3;
	loop for $i=1 $i<=10 $i++;
		$j = xhp.check($i,9,10);
		print $i $j;
		if $j > 0;
			print $9 $10;
		end if;
	end loop;
	$u = xhp.used();
	$m = xhp.maxi();
	print $u $m;
	$j = xhp.free();
	RETURN $ERROR;
END PROC;

Class Hash static;
	xhp=0;
	func Hash(klen,maxreg,pre,dflg);
		xhp = XHash('New',klen,maxreg,pre,dflg);
		return 0;
	end func;
	func Hash(klen,maxreg,pre);
		xhp = XHash('New',klen,maxreg,pre);
		return 0;
	end func;
	func Hash(klen,maxreg);
		xhp = XHash('New',klen,maxreg);
		return 0;
	end func;
	func store(key,data);
		return XHash(xhp,'S',key,data);
	end func;
	func refer(key);
		return XHash(xhp,'R',key);
	end func;
	func check(i);
		return XHash(xhp,'K',i);
	end func;
	func check(i,k);
		return XHash(xhp,'K',i,k);
	end func;
	func check(i,k,d);
		return XHash(xhp,'K',i,k,d);
	end func;
	func used;
		return XHash(xhp,'U');
	end func;
	func maxi;
		return XHash(xhp,'M');
	end func;
	func free;
		return XHash(xhp,'Free');
	end func;
end class;
