


check some string against a list of strings includes error message. THIS IS NO USER FUNCTION


0001 function checkArgumentList(argList, msg, input) 0002 % check some string against a list of strings 0003 % 0004 % includes error message. 0005 % 0006 % THIS IS NO USER FUNCTION 0007 0008 % The elk-library: convex geometry applied to crystallization modeling. 0009 % Copyright (C) 2013 Alexander Reinhold 0010 % 0011 % This program is free software: you can redistribute it and/or modify it 0012 % under the terms of the GNU General Public License as published by the 0013 % Free Software Foundation, either version 3 of the License, or (at your 0014 % option) any later version. 0015 % 0016 % This program is distributed in the hope that it will be useful, but 0017 % WITHOUT ANY WARRANTY; without even the implied warranty of 0018 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0019 % General Public License for more details. 0020 % 0021 % You should have received a copy of the GNU General Public License along 0022 % with this program. If not, see <http://www.gnu.org/licenses/>. 0023 0024 flagKnown = false; 0025 for iElement = 1:length(argList) 0026 if strcmpi(input, argList{iElement}(1:end-1)) 0027 flagKnown = true; 0028 break; 0029 end 0030 end 0031 if ~flagKnown 0032 error('elk:approximation:wrongInput', [msg '-- You used: ''' ... 0033 input '''']); 0034 end