Re: Issue on newArray macro function
Posted by
Wayne Rasband-2 on
URL: http://imagej.273.s1.nabble.com/Issue-on-newArray-macro-function-tp5019886p5019891.html
On Jan 16, 2018, at 7:37 AM, Philippe CARL <
[hidden email]> wrote:
>
> Dear all (probably Wayne),
>
> I have found an issue in the newArray function within what can be a very
> simple macro.
>
> Indeed, the following code is working:
>
> a = newArray(5, 5+2);
>
> Array.print(a);
>
> As the following code:
>
> a = newArray(5+1, 5+2);
>
> Array.print(a);
>
> Is throwing the error that it is expecting an ")" instead of the ",”.
Hi Philippe,
Your proposed fix for this bug is in the latest daily build (1.51u12).
-wayne
> Which means that is there is something else than "," after the first element
> it interprets the code as being a newArray(size).
>
> I guess the fix for this issue would be to replace the line
>
> if (next==STRING_CONSTANT || nextNext==','
>
> || nextNext=='[' || next=='-' || next==PI)
>
> return initNewArray();
>
> With
>
> if (next==STRING_CONSTANT || nextNext==',' || next==PI
>
> || nextNext=='[' || next=='+' || next=='-' || next=='*' ||
> next=='/')
>
> return initNewArray();
>
> Within the "Variable[] newArray" method in the " ij.macro. Functions.java"
> file.
>
> My best regards,
>
> Philippe
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html