h_1 = WndCreat ([], "Provera nedostajucih labela", [NaN,NaN,406,110], 2);

CtrCreat (h_1, 510, [9,10,200,13], "Ime SPSS data fajla za proveru");
h_2 = CtrCreat (h_1, 410, [9,24,320,20], "");
CtrCreat (h_1, 110, [334,24,58,20], "Browse ...","f=FileOpenDialog(h_1);if (strlen(f));CtrSet(h_2,f);end;");

CtrCreat (h_1, 110, [228,55,48,23], "OK","nf1 = CtrGet(h_2);if (strlen(nf1));WndClose(h_1);LabelCheck_m;end;");
CtrCreat (h_1, 110, [281,55,48,23], "Cancel","WndClose(h_1);");


global macro LabelCheck_m
	DataOpen(nf1)
	for i=1:nvar
		if (~strlen(GetVarLabel(i)))
			print(sprintf("%8s - Nedostaje labela VARIJABLE",GetVarName(i)),[],[]);
		end
		if (isnum(Data(1,i)) & ~sum(Data(:,i)~=floor(Data(:,i))))
			[v,f] = freq(Data(:,i));
			a=size(v,1);
			if v(a)==NaN
				v(a)=[];
				f(a)=[];
			end
			if size(v,1)
				%xxx = ~strlen(GetNumLabel(i,v));
				%index = find(xxx);
				if sum(~strlen(GetNumLabel(i,v)))
					%print(sprintf("%8s - %d - Nedostaje labela vrednosti - %s",GetVarName(i),v(index(1)),GetVarLabel(i)),[],[])
					print(sprintf("%8s - Nedostaje labela vrednosti - %s",GetVarName(i),GetVarLabel(i)),[],[])
				end
			end
		end
	end
	print("\n           THE END",[],[])
end	
