# HG changeset patch # User Francesco Potortì # Date 1223914569 -7200 # Node ID 97eab9de6981c2318404df977078b6eba5252ad2 # Parent 8275ba2cbfce3db582f5d44fd615ca1292802a4d Wrong if statement substituted with a switch diff -r 8275ba2cbfce -r 97eab9de6981 scripts/ChangeLog --- a/scripts/ChangeLog Mon Jan 12 11:01:30 2009 +0100 +++ b/scripts/ChangeLog Mon Oct 13 18:16:09 2008 +0200 @@ -1,3 +1,8 @@ +2008-10-13 Francesco Potorti + + * plot/__errplot__.m: Wrong if switch compared strings using ==. + Subsituted with a switch statement. + 2008-12-26 Francesco Potortì * general/prepad.m: Add reference to postpad. diff -r 8275ba2cbfce -r 97eab9de6981 scripts/plot/__errplot__.m --- a/scripts/plot/__errplot__.m Mon Jan 12 11:01:30 2009 +0100 +++ b/scripts/plot/__errplot__.m Mon Oct 13 18:16:09 2008 +0200 @@ -35,21 +35,22 @@ for i = 1:nplots ## Set the plot type based on linestyle. - if (fmt.linestyle == "~") - ifmt = "yerr"; - elseif (fmt.linestyle == ">") - ifmt = "xerr"; - elseif (fmt.linestyle == "~>") - ifmt = "xyerr"; - elseif (fmt.linestyle == "#") - ifmt = "box"; - elseif (fmt.linestyle == "#~") - ifmt = "boxy"; - elseif (fmt.linestyle == "#~>") - ifmt = "boxxy"; - else - print_usage (); - endif + switch (fmt.linestyle) + case "~" + ifmt = "yerr"; + case ">" + ifmt = "xerr"; + case "~>" + ifmt = "xyerr"; + case "#" + ifmt = "box"; + case "#~" + ifmt = "boxy"; + case "#~>" + ifmt = "boxxy"; + otherwise + print_usage (); + endswitch h = __line__ (p);