Hi,
Most of the LabTalk operations base on columns. So there is no simple way to add/insert rows right now. To do this, you need to transpose the worksheet first, add columns, and then transpose it back.
I wrote an example for you to start. Suppose you have your XY data in Sheet1, Book1. X data is like: 5, 10, 15, 20 Activate Sheet1 and run the following scripts:
nrows=wks.nrows;
wtranspose;
//add columns and fill in values
for(ii=1;ii<nrows;ii++)
{
for(jj=1;jj<=4;jj++)
{
wks.AddCol();
col($(4*(ii--1)+jj+nrows))[1]=$(5*ii+jj);
}
}
wtranspose; //transpose the worksheet back
//delete the empty columns
ncols=wks.ncols;
range aa=col(3):col($(ncols));
del aa;
sort -w book1 book1_a; //sort sheet1 in ascending order against col(a)