%ver 1.1
srt=0;
miss=0;
srtvl=0;
ltperc=0;
if ncase
	h_1  = WndCreat ([], "Select Cases", [NaN,NaN,371,275], 2);
	h_2  = CtrCreat (h_1, 110, [295,217,60,23], "Paste","paste");
	h_3  = CtrCreat (h_1, 110, [230,217,60,23], "Cancel","WndClose(h_1)");
	h_4  = CtrCreat (h_1, 110, [165,217,60,23], "OK","ok");
	
	CtrCreat (h_1, 510, [11,15,144,13], "Spisak varijabli:");
	a = GetVarName(1:nvar);
	b = find(~strcmp(a,filter_name));
	if b~=[]
		a(b) = [];
	end
	h_5  = CtrCreat (h_1, 320, [11,28,138,212], lcase(a));
	CtrCreat (h_1, 510, [230,35,125,13], "Izaberite filtar:");
	h_6  = CtrCreat (h_1, 310, [224,48,131,20], lcase(filter_name));
	CtrMaxList(h_6,1);
	
	h_8 = CtrCreat (h_1, 150, [165,48,41,16], "","");
	
	CtrCreat (h_1, 510, [165,150,200,13], "Bice selektovani oni recordi koji imaju");
	CtrCreat (h_1, 510, [165,163,200,13], "vrednost filter varijable razlicitu od nule.");
	
	CtrConect(h_8,h_5,h_6);
	clear a, b
else
	MsgBox([],"Morate prvo ucitati SPSS podatke");
end

global macro paste
	vars=CtrGet(h_6);
	if size(vars,1)==0
		syntax("DataSelect()");
		return;
	end
	vars = ucase(vars);
	syntax("DataSelect(\"" + vars + "\")");
	WndClose(h_1);
end

global macro ok
	vars=CtrGet(h_6);
	if size(vars,1)==0
		DataSelect();
		return;
	end
	vars = ucase(vars);
	DataSelect(vars);
	WndClose(h_1);
end