function [ok,varargout] = found(text,array)
% FOUND set to true when text is found in an array index
%
% syntax:
%    ok=found(text,array)

ok = ~isempty(find(strcmpi(array,text)));

if ok 
    if nargout > 1
        varargout{1} = find(strcmpi(array,text));
    end
else
    if nargout > 1
        varargout{1} = -1;
    end
end
