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
 Accessing data from different sheets

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
DerPionier Posted - 02/09/2011 : 07:27:32 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 02/09/2011 : 9:45:49 PM
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

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