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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 subtract 2 sheets in the same book
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

elena_loginova

USA
Posts

Posted - 10/06/2009 :  9:56:25 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.: 8 SR 1
Operating System: Windows XP

Hi,

I would appreciate your help in writing a script to subtract two sheets (baseline from rawdata) in the same book. The following script that I wrote doesn't work:

loop (i, 1, rawdata.ncols) {
range a = [Book1]rawdata!Col(i);
range b = [Book1]baseline!Col(i);
range c = [Book1]data!Col(i);
c = a - b; }

Thank you in advance for your help!

elena_loginova

USA
Posts

Posted - 10/07/2009 :  6:33:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It might be useful to somebody else. I understood, why it doesn't work: I had to use $i instead of i.

loop (i,1,1000) {
range a = [Book1]rawdata!Col($(i));
range b = [Book1]baseline!Col($(i));
range c = [Book1]data!Col($(i));
c = a - b;
};
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 10/07/2009 :  9:26:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
instead of col($(i)), better use wcol(i).

CP
Go to Top of Page

elena_loginova

USA
Posts

Posted - 10/12/2009 :  8:35:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000