Author |
Topic  |
|
q-vector
4 Posts |
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 |
|
yuki_wu
896 Posts |
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
|
 |
|
q-vector
4 Posts |
Posted - 06/21/2019 : 08:07:36 AM
|
Thank you, Yuki that helped a lot. |
 |
|
|
Topic  |
|
|
|