I have a For loop that inspects each text box in a V List Box, and is supposed to return the size of each. For some reason it will not work though:
Names Default to Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
win = New Window("Temp",
VLB = VListBox();
);
names = Column("Name") << Get Values;
//Write to window
For(j=1, j<=NItems(names), j++,
tb = TextBox(names[j]);
VLB << Append(tb);
text = VLB[j] << Get Text; //This works...
width = (VLB[j] << Get Size); //...but this just returns 0
Show(j, text, width);
);
//Nor does this work when I run with the script above, but does work if I run as a single line of code afterwards:
width = (VLB[1] << Get Size);
Show(width);As I indicated, the " << Get Text" command works fine, but not the " << Get Size" command. Also, and even outside the For loop, the " << Get Size" command does not work when I run the whole script. Only if I run it as a single line of code after I've run the rest of the script will it work.
It must have something to do with appending the textboxes to VLB, but I can't understand what it is.