Skip to content
Snippets Groups Projects
Commit 8bc1fc30 authored by Dóra Kocsis's avatar Dóra Kocsis
Browse files

fix bug in mapping nested options in set_command_option

parent 09bd6e85
No related branches found
No related tags found
No related merge requests found
......@@ -115,7 +115,12 @@ try
end
otherwise
options_.(gui_auxiliary.command_option_mapping(name)) = value;
if isnumeric(value)
eval(['options_.' gui_auxiliary.command_option_mapping(name) '=' num2str(value) ';']);
  • In this situation, why would you prefer the eval construct ? Isn't this better: options_.(gui_auxiliary.command_option_mapping(name)) = value;

  • There was a problem with nested options (eg: estimation.moments_posterior_density.indicator) in this case this syntax options_.(gui_auxiliary.command_option_mapping(name)) failed to populate the options_ field. There was no error because the switch is inside a try-catch statement.

  • Sorry, I misspoke. Please mention this in the commit message

    Edited by Houtan Bastani
  • Please register or sign in to reply
else
eval_expr = sprintf("options_.%s='%s';", gui_auxiliary.command_option_mapping(name), value);
  • And here, is the problem that sometimes the value passed is not a string? Otherwise, what was there previously should work. What variable type for value ends up here that was not handled by the previous statement, options_.(gui_auxiliary.command_option_mapping(name)) = value;

    Edited by Houtan Bastani
  • Please register or sign in to reply
eval(eval_expr);
end
end
catch
status = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment