function vars = resolveSet(vars)
	if def(vars)
		vars=ucase(vars);
	else
		error("Nije specificiran 'vars' argument")
	end
	if size(vars,1)>1
		vars = vars';
	end
	len = size(vars,2);
	i = len;
	if len==1
		if left(vars,2)=="$$"
			eval("global "+vars+";pom="+vars+";");
			vars = pom;
			len = max(size(pom));
			i = i+len-1;
		end
		i = i-1;
	end
	while i>0
		if left(vars(i),2)=="$$"
			eval("global "+vars(i)+";pom="+vars(i)+";");
			if 1==i
				vars = [pom, vars(2:NaN)];
			elseif len==i
				vars = [vars(1:i-1),pom];
			else
				vars = [vars(1:i-1), pom, vars(i+1:NaN)];
			end
			k = max(size(pom))-1;
			i = i+k;
			len = len+k;
		end
		i=i-1;
	end
	resolve_to(vars);
end