Login  Register

Re: image name as a variable

Posted by CARL Philippe (LBP) on Jul 26, 2018; 7:40am
URL: http://imagej.273.s1.nabble.com/image-name-as-a-variable-tp5005464p5020998.html

Dear Pankaj,
What the operation the operator "+" you are referring below is doing is a called a "concatenation of strings".
With "Strings" being a "chain of characters".
For example if you write the following simple macro code
        two = 2.0;
        test = "this" + " " + "is" + " " + "a" + " " + "test" + " " + "for" + " " + two;
        print(test);
the result will give you:
        this is a test for 2
Please note that I have defined the variable "two" as a float which is thus automatically transformed into a String (the java operation for doing this would be to use String.valueOf(two)) and tranparently concatened to the rest of the string.
Hoping that my short explanations help you to move further, I wish you a nice day.
My best regards,
Philippe


Le Jeudi 26 Juillet 2018 06:44 CEST, pduw <[hidden email]> a écrit:

> I am a novice and just started using ImageJ macros. I wanted to solve the
> same problem as OP, which is solved now. But I am wondering what does the
> ["+temp+"] does, what's the significance of the + here?
>
> If I remove + merge does not happen
>
> thank you
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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