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
 Accessing data from different sheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

DerPionier

Germany
Posts

Posted - 02/09/2011 :  07:27:32 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,

I am quite sure this is an really easy question but I could not find the answer even though I searched the internet and the origin labTalk wiki the whole day.

I want to perform calculations on different columns which are located in different datasheets but within one worksheet.

This is a part of what I programmed:


range rO2 = O2!;			
range rN2 = N2!;			

rO2.AddCol(currentcor);

//collectionefficiency
coleff = 0.24;

//correct curent with N2 measurement

rO2.col(currentcor) = rO2.col(WE(2).Current (A)) - rN2.col(WE(2).Current (A));


the Datasheets are named O2 and N2. Adding the colums with rO2.Addcol works fine, but accessing the data with rO2.col() does not work. Nor does wcol(). It doesnt matter if I use numbers or the name of the sheet within the parentheses.

Could someone please give me a hint on how I should access the data? Thanks a lot...

Origin Ver. and Service Release (Select Help-->About Origin): 8.5 SR1
Operating System: Win XP

Penn

China
644 Posts

Posted - 02/09/2011 :  9:45:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can use the column range to access the data in columns. For example,

range rO2 = O2!;
range rN2 = N2!;
rO2.AddCol(currentcor);

range rO2Currentcor = O2!col(currentcor);  // the newly added column range
range rO2Col = %(rO2)col(WE(2).Current (A));  // column range in O2 worksheet, use sheet range variable with %() substitution
// range rO2Col = O2!col(WE(2).Current (A));  // use sheet name to declare column range directly
range rN2Col = %(rN2)col(WE(2).Current (A));  // column range in N2 worksheet
rO2Currentcor = rO2Col - rN2Col;  

Please note that you can use both worksheet name and worksheet range variable to declare column range. However, when using worksheet range variable, the %() substitution is needed. You can see the difference in the script above.

For more information about range, please refer to this page.

Penn

Edited by - Penn on 02/10/2011 04:36:01 AM
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