Fix workspace if dynare is called from a function.

time-shift
Stéphane Adjemian (Charybdis) 2021-05-26 19:07:44 +02:00
parent 1645f38269
commit 2743ca8fdb
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 5 additions and 5 deletions

View File

@ -278,15 +278,15 @@ end
clear(['+' fname '/driver'])
try
evalin('base',[fname '.driver']) ;
evalin('base',[fname '.driver']);
catch ME
W = evalin('base','whos');
W = evalin('caller','whos');
diary off
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
rethrow(ME)
end
rethrow(ME)
end
end
diary off