v4 dynare.m: cosmetic changes
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1942 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
57f4d42a5b
commit
d9ffbb3e79
|
@ -31,10 +31,6 @@ else
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if nargin < 1
|
|
||||||
error('You must provide the name of the MOD file in argument');
|
|
||||||
end
|
|
||||||
|
|
||||||
% disable output paging (it is on by default on Octave)
|
% disable output paging (it is on by default on Octave)
|
||||||
more off
|
more off
|
||||||
|
|
||||||
|
@ -43,11 +39,16 @@ if exist('OCTAVE_VERSION')
|
||||||
default_save_options('-mat')
|
default_save_options('-mat')
|
||||||
end
|
end
|
||||||
|
|
||||||
if ~ischar(fname)
|
% detect if MEX files are present; if not, use alternative M-files
|
||||||
error ('The argument in DYNARE must be a text string.') ;
|
dynareroot = dynare_config();
|
||||||
|
|
||||||
|
if nargin < 1
|
||||||
|
error('DYNARE: you must provide the name of the MOD file in argument')
|
||||||
end
|
end
|
||||||
|
|
||||||
dynareroot = dynare_config();
|
if ~ischar(fname)
|
||||||
|
error('DYNARE: argument of dynare must be a text string')
|
||||||
|
end
|
||||||
|
|
||||||
% Testing if file have extension
|
% Testing if file have extension
|
||||||
% If no extension defalut .mod is added
|
% If no extension defalut .mod is added
|
||||||
|
@ -62,13 +63,12 @@ if isempty(strfind(fname,'.'))
|
||||||
else
|
else
|
||||||
if ~strcmp(upper(fname(size(fname,2)-3:size(fname,2))),'.MOD') ...
|
if ~strcmp(upper(fname(size(fname,2)-3:size(fname,2))),'.MOD') ...
|
||||||
&& ~strcmp(upper(fname(size(fname,2)-3:size(fname,2))),'.DYN')
|
&& ~strcmp(upper(fname(size(fname,2)-3:size(fname,2))),'.DYN')
|
||||||
error ('Argument is a file name with .mod or .dyn extension');
|
error('DYNARE: argument must be a filename with .mod or .dyn extension')
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
d = dir(fname);
|
d = dir(fname);
|
||||||
if length(d) == 0
|
if length(d) == 0
|
||||||
disp(['DYNARE: can''t open ' fname])
|
error(['DYNARE: can''t open ' fname])
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
|
||||||
command = ['"' dynareroot 'dynare_m" ' fname] ;
|
command = ['"' dynareroot 'dynare_m" ' fname] ;
|
||||||
|
@ -79,7 +79,7 @@ end
|
||||||
disp(result)
|
disp(result)
|
||||||
if status
|
if status
|
||||||
% Should not use "error(result)" since message will be truncated if too long
|
% Should not use "error(result)" since message will be truncated if too long
|
||||||
error('Preprocessing failed')
|
error('DYNARE: preprocessing failed')
|
||||||
end
|
end
|
||||||
|
|
||||||
if ~ isempty(find(abs(fname) == 46))
|
if ~ isempty(find(abs(fname) == 46))
|
||||||
|
|
Loading…
Reference in New Issue