Print on the same line in the log

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Print on the same line in the log

ERIC
Hi ImageJ users,

  I want to print in the log all the values of an Array, but on the same
line. Each time the print function is used it creates a new line and I
dont know how to avoid this. Can you help me ?
Thanks

Eric
Reply | Threaded
Open this post in threaded view
|

Re: Print on the same line in the log

fabrice senger-2
Hi Eric,

I don't think you can play arouns with the log window, I would rather try
to built a custom results table as demonstrated here :

http://rsbweb.nih.gov/ij/macros/CustomTabStatFromResults.txt

Cheers,

Fabrice.

2011/11/9 Eric Denarier <[hidden email]>

> Hi ImageJ users,
>
>  I want to print in the log all the values of an Array, but on the same
> line. Each time the print function is used it creates a new line and I dont
> know how to avoid this. Can you help me ?
> Thanks
>
> Eric
>
Reply | Threaded
Open this post in threaded view
|

Re: Print on the same line in the log

lechristophe
In reply to this post by ERIC
Hi Eric,

To print on one line, just make a loop that concatenates what you want
to print in a single string using "+" before printing the whole
string, like so:

array = newArray(1, 2, 3, 4);
line = "";
for (i = 0; i < array.length; i++) {
line = line + array[i] +" ";
}
print(Line);

Christophe

On Wed, Nov 9, 2011 at 09:49, Eric Denarier
<[hidden email]> wrote:
> Hi ImageJ users,
>
>  I want to print in the log all the values of an Array, but on the same
> line. Each time the print function is used it creates a new line and I dont
> know how to avoid this. Can you help me ?
> Thanks
>
> Eric
>