/loadini {
/var %ini_file = $$1, %hash_output_name = $iif($2,$2,%ini_file)
echo -s >>Loading $qt(%ini_file) to $qt(%hash_output_name)
if ($hget(%hash_output_name)) hfree %hash_output_name
hmake %hash_output_name 10
/var %outer = $ini(%ini_file,0), %inner, %t1, %t2
while (%outer > 0) {
%inner = $ini(%ini_file,%outer,0)
while (%inner > 0) {
%t1 = $ini(%ini_file,%outer)
%t2 = $ini(%ini_file,%outer,%inner)
hadd %hash_output_name $+(%t1,.,%t2) $eval($readini(%ini_file,n,%t1,%t2),1)
dec %inner
}
dec %outer
}
}
/settings {
/var %ini = Misc.ini
if (!$hget(settings)) loadini %ini settings
if ($isid) return $iif($1,$hget(settings,$+($1,.,$$2)),%ini)
/writeini %ini $1 $2 $$3-
/hadd settings $+($1,.,$2) $3-
}