Login  Register

Re: String variable made with other variables?

Posted by ctrueden on Feb 25, 2016; 4:00pm
URL: http://imagej.273.s1.nabble.com/String-variable-made-with-other-variables-tp5015716p5015717.html

Hi Philippe,

> I cannot get this variable d to store a string containing the b and e
> values with a dash in between...

Try this:

  d = b + "-" + e;
  run("Make Substack...", "delete slices=" + d);

Or shorter:

  run("Make Substack...", "delete slices=" + b + "-" + e);

See also:

  http://imagej.net/Introduction_into_Macro_Programming#Using_variables

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Thu, Feb 25, 2016 at 9:55 AM, Philippe P <[hidden email]> wrote:

> Hi list,
>
> I want to write a Macro to create substacks with variables to define of
> the portion to cut out.
> I have variable "b" and "e" that store the beginning and ending frames of
> the deletion needed.
> I would like to store in a variable "d" the string:
> b-e
> so I can use this string variable to set-up the deletion needed in:
> run("Make Substack...", "delete slices=&d");
>
> I cannot get this variable d to store a string containing the b and e
> values with a dash in between...
>
> Any suggestion would be appreciated.
>
> Thanks,
> Philippe
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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