T O P I C R E V I E W |
JoannaZajac |
Posted - 10/06/2011 : 08:23:12 AM Hi, I use Origin 8 and 7 under WINXP, Ive written a program in a code builder in Origin 8 to subtract background, which is 1 column of the data set, from each column inside big data set, it is working fine in origin 8, code attached below; now I want to use this code with Origin 7, and it not supports it, any comments on how to rewrite it in simple manner that it is going to work under origin 7 are welcome, thanks
string strBk$ = D21400; string strSh$ = Sheet1; range rSh = [strBk$]strSh$!; range rDa = [strBk$]strSh$!col(cut0y); loop(ii,4,rSh.nCols) { range rDb = [strBk$]strSh$!wcol(ii); rDb = rDb-rDa; }
Joanna |
3 L A T E S T R E P L I E S (Newest First) |
Penn |
Posted - 10/11/2011 : 06:31:04 AM Hi Joanna,
The run.file() method accepts the file name, but not the dataset. If you want to pass dataset as argument, you can use run.section() method instead. For example, there is an ogs file named Custom.ogs include the following script:
[Main] // section name
layer.plotxy(%1, %2); // accept two argument, %1 and %2
Then, I will assume there is a worksheet named Data1, and there are two columns, A and B in the worksheet. Now, activate a graph window and run the following script:
// pass column A and B to %1 and %2 respectively, so to plot to the layer
run.section(Custom, Main, data1_A data1_B);
Penn |
JoannaZajac |
Posted - 10/10/2011 : 08:45:10 AM Hi Penn, could you tell me if it is possible in LabTalk, Origin7 to access data set from the script(ogs file) by passing dataset as argument in run.file() command? Thanks,
Joanna |
Penn |
Posted - 10/07/2011 : 11:35:04 PM Hi Joanna,
The string and range do not exist in Origin 7, also, the Workbook concept is new since Origin 8, so, your script cannot be executed correctly in Origin 7. If you have activated a worksheet, you can run the following script in Origin 7 to do the same thing.
loop(ii, 4, wks.nCols)
{
col($(ii)) = col($(ii)) - col(cut0y);
}
Penn |
|
|