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
 LabTalk Forum
 Subtract reference data from several columns

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
q-vector Posted - 06/20/2019 : 09:40:11 AM
OriginPro 2016 (64-bit) Sr2 b9.3.2.303
Operating System: Windows 2012 Server

Hi,

I would like to subtract reference data from each column starting with column 20 until 163. I want to solve this by using labtalk with this script:

j=20;
for (j)
{ subtract_ref -r 2 iy1:=[Book1]D0000228!(A,j) iy2:=[Book1]D0000228!(AC1,AE"empty_cell*2.98") common:=1 oy:=<new>;
j = j + 1;
if (j > 163) break;

};

What is wrong here? Is it possible by using the subtract_ref function?

Thank's for your help!

best q-vector
2   L A T E S T    R E P L I E S    (Newest First)
q-vector Posted - 06/21/2019 : 08:07:36 AM
Thank you, Yuki that helped a lot.
yuki_wu Posted - 06/20/2019 : 10:49:09 PM
Hi,

1. Use the for command correctly or use loop command instead.
https://www.originlab.com/doc/LabTalk/ref/For-cmd
https://www.originlab.com/doc/LabTalk/ref/Loop-cmd

2. Correct the range string to make it represent the range object you desired to access.

For example, to subtract the dataset of col(E) and col(F) from column(B) to column(D) with column(A) as X:

loop(ii, 2, 4)
{
subtract_ref -r 2 iy1:=[Book1]Sheet1!(1,%(ii)) iy2:=[Book1]Sheet1!(E,F) common:=1 oy:=<new>;
};


Hope it helps.

Regards,
Yuki
OriginLab

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