Re: String variable made with other variables?
Posted by
lechristophe on
URL: http://imagej.273.s1.nabble.com/String-variable-made-with-other-variables-tp5015716p5015731.html
Hi,
As b and e are variable, they have to be outside the "".
b= 10;
e = 2;
d = b + "-" + e;
print(d);
will work. Or if you want to be really sure that it will be picked as a
string:
b= 10;
e = 2;
d = "" + b + "-" + e;
print(d);
Christophe
On Fri, Feb 26, 2016 at 11:03 AM, Philippe P <
[hidden email]> wrote:
> Thanks Curtis and Christophe for your help.
> Indeed,
> run("Make Substack...", "delete slices=" + b + "-" + e);
> does the job.
> But I cannot set a variable string containing other variables to work.
> Curtis suggestion unfortunately does not work either. For example, if you
> try:
> b= 10;
> e = 2;
> d = "b + "-" + e";
> print(d)
>
> You get an error on "-"
> :-(
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html