Re: Text window name?
Posted by Gabriel Landini on May 17, 2007; 4:29pm
URL: http://imagej.273.s1.nabble.com/Text-window-name-tp3699442p3699444.html
On Thursday 17 May 2007 14:47:28 Curtis Rueden wrote:
> None of this is an
> issue for window titles with no spaces.
I agree in theory, but not in practice :-)
Not sure if this is a bug, then:
This does not work in linux (it prints to the Log window instead):
//======================
f1 = "Test";
f2 = "["+f1+"]";
// --- to a table window
if(!isOpen(f1)){
run("New... ", "name="+f1+" type=Table width=300 height=400");
print(f1, "\\Headings:Filed1\tField2\tField3");
}
x=1;
y=2;
z=3;
print(f1,x+"\t"+y+"\t"+z);
//======================
But this does work (i.e. it prints to the Test table):
The difference is the [ ] in the table creation and the print statements. They
are both strings without spaces.
//======================
f1 = "Test";
f2 = "["+f1+"]";
// --- to a table window
if(!isOpen(f1)){
run("New... ", "name="+f2+" type=Table width=300 height=400");
print(f2, "\\Headings:Filed1\tField2\tField3");
}
x=1;
y=2;
z=3;
print(f2,x+"\t"+y+"\t"+z);
//======================
Cheers,
Gabriel