OK, this is strange. (TS 6.7.1 SP1 Win2K)
I am writing a table template. A replicant of rows, each with a replicant of columns.
Get to the text via
/Root/Table/Row/Column/Text
Caveat, when you add a column in a row other than #1, you cannot exceed the number of items in 1 (heading)
So I have an item handler onReplicantBeforeAdd on /Root/Table/Row/Column, planning on returning false if there are too many columns for that row.
This is the code I use:
functionCheckTable(item);
{var Xpath = item.getName();
var regex = /.*\Column\[(.*?)\].*/;
var out = new Array;
out = Xpath.match(regex);
var newCol=out[1];
return true;
}
There is more, but this shows the issue, if I return true where it currently is located, then the replicant is never added. If I move the return one line up (before the use of out[1]) then the replicant is added.
WTF am I doing wrong ?
Andy
updated: I added a test DCT, moving the return true; around makes it work or not.