annotate aim-mat/tools/@parameter/exist.m @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 20ada0af3d7d
children
rev   line source
tomwalters@0 1 % method of class @parameter
tomwalters@0 2 %
bleeck@3 3 % (c) 2011, University of Southampton
bleeck@3 4 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 5 % download of current version is on the soundsoftware site:
bleeck@3 6 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 7 % documentation and everything is on http://www.acousticscale.org
bleeck@3 8
bleeck@3 9
tomwalters@0 10 function val=exist(param,text,inbox)
tomwalters@0 11 % returns a boolean value that indicates if that string has a valid field
tomwalters@0 12
tomwalters@0 13 cont=param.entries;
tomwalters@0 14 nrent=length(cont);
tomwalters@0 15
tomwalters@0 16 if nargin<3 % search in all subsections
tomwalters@0 17 inbox='all';
tomwalters@0 18 end
tomwalters@0 19
tomwalters@0 20
tomwalters@0 21 nr=getentrynumberbytext(param,text,inbox);
tomwalters@0 22
tomwalters@0 23 if nr>0
tomwalters@0 24 val=1;
tomwalters@0 25 else
tomwalters@0 26 val=0; % we must return a logical value otherwise it can generate difficult errors
tomwalters@0 27 end