The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Background substraction origin

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000