function [varnames,filename,filepath,mode]=sourcepathwaehlen(filename,filepath,mode)
%  

%   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.                                                                      
batchmoderadio=findobj('tag','batchmoderadio');
fileradio=findobj('tag','fileradio');
filebutton=findobj('tag','filebutton');
directoryradio=findobj('tag','directoryradio');
batchfileradio=findobj('tag','batchfileradio');
batchfilebutton=findobj('tag','batchfilebutton');
directorybutton=findobj('tag','directorybutton');
filemonitor=findobj('tag','filemonitor');
batchfilemonitor=findobj('tag','batchfilemonitor');
directorymonitor=findobj('tag','directorymonitor');
searchmonitor=findobj('tag','searchmonitor');
%------------------------------------------------------------------------------
% pfadwaehlen öffnet uigetfile zur Auswahl einer Datei im gemeinten Verzeichnis
%
% Der Pfad wird zurückgegeben in 'pfad', der Name des Files in 'filename'
%
%------------------------------------------------------------------------------

[filename, filepath] = uiputfile('*.*', 'Please create dummy-file in source-directory:', 300, 300);
if isequal(filename,0)| isequal(filepath,0)
       uiwait(errordlg('File not found!','Error:'));
       return
end
mode = 13;

varnames=cell(1);
varnames{1}='filename';
varnames{2}='filepath';
varnames{3}='mode';
if ~isempty(mode)
    set(searchmonitor, 'string', strcat(filepath));
   cd (filepath);
end
return