function[Val,k]=IfEmptyInputSpecVal(SpecIn,AllIn,Default,string1,string2,string3,string4,string5,...
								  string6,string7,string8,string9,string10,string11,string12,string13);
%   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.                                                                      
if nargin<16; string13=[]; end;
if nargin<15; string12=[]; end;
if nargin<14; string11=[]; end;
if nargin<13; string10=[]; end;
if nargin<12; string9=[]; end
if nargin<11; string8=[]; end
if nargin<10; string7=[]; end
if nargin<9; string6=[]; end
if nargin<8; string5=[]; end;
if nargin<7; string4=[]; end
if nargin<6; string3=[]; end
if nargin<5; string2=[]; end
if nargin<4; string1=[]; end
if nargin<3; Default=[]; end
if nargin<2; AllIn=[]; end
if nargin<1; SpecIn=[]; end
if ~isempty(SpecIn); Val=SpecIn; k=1; return; end;
if ~isempty(Default);
	k=[]; k=find(AllIn==Default);
	if isempty(k); error('Bad Default !'); end;
end

if ~isempty(string1); fprintf(string1); fprintf('\n');end;
if ~isempty(string2); fprintf(string2); fprintf('\n');end;
if ~isempty(string3); fprintf(string3); fprintf('\n');end;
if ~isempty(string4); fprintf(string4); fprintf('\n');end;
if ~isempty(string5); fprintf(string5); fprintf('\n');end;
if ~isempty(string6); fprintf(string6); fprintf('\n');end;
if ~isempty(string7); fprintf(string7); fprintf('\n');end;
if ~isempty(string8); fprintf(string8); fprintf('\n');end;
if ~isempty(string9); fprintf(string9); fprintf('\n');end;
if ~isempty(string10); fprintf(string10); fprintf('\n');end;
if ~isempty(string11); fprintf(string11); fprintf('\n');end;
if ~isempty(string12); fprintf(string12); fprintf('\n');end;
if ~isempty(string13); fprintf(string13); fprintf('\n');end;

fprintf('\n')
if ~isempty(Default); fprintf(1,'(The default value is [%g] !)',Default); end

again=1;k=[];
while again
	Val = input(' ');
	if isempty(Val); Val=Default; return; end;
	k=find(AllIn==Val);
	if isempty(k); 
		fprintf('This value is not permitted !\n\n');
		fprintf('Please insert one of the following values:');
		disp(AllIn);
		again=1; 
	else; 
		return; 
	end
end
