function saveselitemsfile
%  

%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.     

global vergleichecell stufenvec filename filepath
[savefilename,savefilepath]=uiputfile('.sim','Bitte Zieldatei benennen:');
if isempty(findstr(savefilename,'.sim'))
    savefilename=[savefilename,'.sim'];
end
vergleichemonitor = findobj('Tag','vergleichemonitor');
vergleichecell=get(vergleichemonitor,'String');
savefile=[savefilepath,savefilename];
fid=fopen(savefile,'wt');

%Vergleiche
if ~isempty(vergleichecell)
fprintf(fid,vergleichecell{1});
for h=2:size(vergleichecell,1)
    fprintf(fid,['\n',vergleichecell{h}]);
end
fprintf(fid,'\n');
end
fprintf(fid,'\n');

%Faktoren und Stufen
for j=1:size(stufenvec,1)
    fprintf(fid,[num2str(stufenvec(j)),'\n']);
end
fprintf(fid,'\n');

%Parameterfile
fprintf(fid,'%s',[filepath,filename]);
fclose(fid);
return