Fix workspace if dynare is called from a function.
parent
1645f38269
commit
2743ca8fdb
|
@ -278,15 +278,15 @@ end
|
||||||
clear(['+' fname '/driver'])
|
clear(['+' fname '/driver'])
|
||||||
|
|
||||||
try
|
try
|
||||||
evalin('base',[fname '.driver']) ;
|
evalin('base',[fname '.driver']);
|
||||||
catch ME
|
catch ME
|
||||||
W = evalin('base','whos');
|
W = evalin('caller','whos');
|
||||||
diary off
|
diary off
|
||||||
if ismember(fname,{W(:).name})
|
if ismember(fname,{W(:).name})
|
||||||
error('Your base workspace already contains a variable with the same name as the mod-file. You need to delete it or rename the mod-file.')
|
error('Your base workspace already contains a variable with the same name as the mod-file. You need to delete it or rename the mod-file.')
|
||||||
else
|
else
|
||||||
rethrow(ME)
|
rethrow(ME)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
diary off
|
diary off
|
||||||
|
|
Loading…
Reference in New Issue