function[File,Path,FilePath]=WriteFilePath(initFile,dialogTitle,x,y,ClearStatus,string1,string2,string3)
%   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.                                                                      
%==================================================================
%
%	WriteFilePath.m
%
%	Markus Junghoefer	[1996]
%
%
%	Function definition
% 
% 
% 	% 
%==================================================================
if nargin<8;string3=[]; end;
if nargin<7;string2=[]; end;
if nargin<6;string1='Please choose the file:  '; end;
if nargin<5;ClearStatus=0; end;
if nargin<4; y=[]; end;
if nargin<3; x=[]; end;
if nargin<2;dialogTitle='Write data to file:' ; end;
if nargin<1;initFile= '*' ; end;


if ClearStatus; fprintf('\n');clc; end
if ~isempty(string1); fprintf(string1); fprintf('\n'); end
if ~isempty(string2); fprintf(string2); fprintf('\n'); end
if ~isempty(string3); fprintf(string3); fprintf('\n'); end

if isempty(x) | isempty(y)
	[File,Path]=uiputfile(initFile,dialogTitle);
else
	[File,Path]=uiputfile(initFile,dialogTitle,x,y);
end
FilePath=[Path,File];
return;
