if ncase
	rew = 0;
	h_1 = WndCreat ([], "Binary to Multiple", [NaN,NaN,296,472], 2);
	
	CtrCreat (h_1, 510, [9,9,104,16], "All variables");
	h_2 = CtrCreat (h_1, 320, [9,25,112,199], lcase(GetVarName(find(DataVarType))),"h_g=h_2;update();");
	CtrCreat (h_1, 510, [169,9,104,16], "Selected variables");
	h_3 = CtrCreat (h_1, 320, [169,25,112,199], "","h_g=h_3;update();");
	h_4 = CtrCreat (h_1, 150, [129,105,32,20], "","");
	
	CtrConect(h_4,h_2,h_3);
	
	CtrCreat (h_1, 140, [9,233,272,64], "Active variable label");
	h_5 = CtrCreat (h_1, 510, [17,249,256,40], "");
	
	h_6 = CtrCreat (h_1, 140, [9,297,272,112], "Options");
	CtrCreat (h_1, 510, [41,316,144,16], "Prefix fo new variables:");
	h_7 = CtrCreat (h_1, 410, [185,313,56,20], "");
	CtrCreat (h_1, 510, [41,340,128,16], "Value of 'Yes' response:");
	h_8 = CtrCreat (h_1, 410, [185,337,56,20], "1");
	CtrCreat (h_1, 510, [41,364,128,16], "Value for 'None' response:");
	h_9 = CtrCreat (h_1, 410, [185,361,56,20], "0");
	CtrCreat (h_1, 130, [41,385,152,16], "Rewrite existing variables","rew=~rew;");
	
	CtrCreat (h_1, 110, [ 97,417,56,24], "OK","check; if chi;WndClose(h_1);bin2mul(vars,pref,rewrite,valyes,valnone);end;");
	CtrCreat (h_1, 110, [161,417,56,24], "Cancel","WndClose(h_1)");
	CtrCreat (h_1, 110, [225,417,56,24], "Paste","check; if chi;paste;WndClose(h_1);end;");
else
	MsgBox([],"Morate prvo ucitati SPSS podatke");
end

global macro update
	vars = CtrGet(h_g,1);
	if size(vars,1)
		vars = ucase(vars);
		labVar=GetVarLabel(vars(1));
		CtrSet(h_5,labVar);
	end
end

global macro check
	chi = 0;
	vars = CtrGet(h_3);
	if ~size(vars,1)
		MsgBox(h_1,"Niste izabrali ni jednu varijablu!",1);
		return;
	end
	pref = CtrGet(h_7);
	if ~strlen(pref)
		MsgBox(h_1,"Niste naveli prefix za nove varijable!",1);
		return;
	end
	valnone = lcase(CtrGet(h_9));
	if valnone=="." | valnone=="nan"
		valnone = NaN;
	end
	valyes = CtrGet(h_8);
	if ~strlen(valyes)
		valyes=0;
	end
	if rew
		rewrite = "rewrite";
	else
		rewrite = "";
	end
	chi = 1;
end

global macro paste
	str = "\n\n!bin2mul vars = ";
	for i=1:max(size(vars))
		str = str+" "+vars(i);
	end
	str = str+"/\n         prefix = " + pref;
	if isstr(valnone)
		str = str+"/\n         nonvalue = " + valnone;
	else
		if valnone~=NaN
			str = str+ sprintf("/\n        nonvalue = %d",valnone);
		end
	end
	if isstr(valyes)
		str = str+"/\n         value = " + valyes;
	else
		if valyes~=NaN
			str = str+ sprintf("/\n         value = %d",valyes);
		end
	end
	if rew
		str = str+"/\n         options = rewrite";
	end
	str = str+" .";
	syntax(str);
end