function varargout=dopOSCCIgetFileList(folder,varargin)
% dopOSCCI Mark II: dopOSCCIgetFileList ~ 15-Dec-10 (last edit)
%
% look for TX/TW files and, if empty, look for EXP
%
% [fileList report]=dopOSCCIgetFileList(folder,[comment]);
%
% comment = display function comments/txt on the way through script
%
try
    fl.fileList=[];
    fl.report=[];
    fl.fileType='TX';
    fl.comment=1;
    fl.folder=folder;
    if ~isempty(varargin) && isnumeric(varargin{1}) && varargin{1}<=1
        fl.comment=varargin{1};
    end
    if ~strcmp(fl.folder(end),'\')
        fl.folder=[fl.folder,'\'];
    end
    [fl.fileList fl.report]=getTXfileList(fl.folder,fl.comment);
    disp(fl.report)
    if isempty(fl.fileList)
        % EXP check
        fl.fileType='EXP';
        [fl.fileList fl.report]=getEXPfileList(fl.folder,fl.comment);
        disp(fl.report)
    end
    
    varargout{1}=fl.fileList;
    varargout{2}=fl.report;
    varargout{3}=fl.fileType;
catch err
    %% catch dopOSCCI error
    % 
save(dopOSCCIdebug(mfilename));throw(err); 
%     dopOSCCIcrash(err,fl,mfilename);
end