Array.trim() not trimming - macOS 10.14.6, ImageJ v1.53d45

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Array.trim() not trimming - macOS 10.14.6, ImageJ v1.53d45

Bill Christens-Barry-2
Hi,

Array.trim() isn't doing what I expected in a macro, vis:

a = newArray("one", "two", "three", "four");

print("before trim:")
print("    " + "a.length = " + a.length);
print("    " + a.length, a[0], a[1], a[2], a[3]);
print("");
Array.trim(a, 2);
print("after \"Array.trim(a, 2);\":")
print("    " + "a.length = " + a.length);
print("    " + a.length, a[0], a[1], a[2], a[3]);

=>

before trim:
    a.length = 4
    4 one two three four

after "Array.trim(a, 2);":
    a.length = 4
    4 one two three four

Kind of like my hair during lockdown...

Bill Christens-Barry

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Array.trim() not trimming - macOS 10.14.6, ImageJ v1.53d45

Bill Christens-Barry-2
Hi again,

OK, nevermind. Once again I've forgotten to return the result of the command. All is well with the operation.

Bill Christens-Barry

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html