Hi.
To output to a notes window or the result log, you can refer to the type object in the Labtalk Language Reference.
To loop over the worksheets in the current folder, you can use
doc -ef w {...}.
The following script creates a notes window, searches through all the worksheets in the current folder for all the x values that is equal to 3, and then outputs the value in the second column in the same row. The X values are assumed to be in the first column of each worksheet. I think you can modify this script to suit your need.
//Create a notes window with the title ExtractResult
window -n n ExtractResult;
//Set the notes window as the current output window.
type.notes$=ExtractResult;
old = type.redirection;
type.redirection = 2;
type "Extractiong result:";
doc -ef w
{ //loop over all the worksheets in current folder
nrow=wks.maxRows; //The maximum row index number that contains a value
for (ii=1; ii<nrow; ii++) //loop over the rows
{
%a=%(%h, 1, $(ii));
if (%a==3)
{
type %h; //Type the name of the worksheet
type $(%(%h, 2, $(ii))); //Type the corresponding value in column 2
};
};
};
type.redirection = old; //Restore the output window
Deanna
OriginLab GZ Office
Edited by - Deanna on 08/30/2006 10:09:25 PM