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 in different worksheets

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
anvogt Posted - 07/23/2004 : 03:43:54 AM
Hi,
how do I address data (individual values) of different worksheets?
E.g. I want to multiply a value in woksheet Data1 with a value in worksheet Data2 and place the result in a third worksheet Data3.

Thank you,
Andreas
4   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 12/03/2004 : 10:18:02 PM
quote:

Good question. Too bad the info is not here.



Hello,

You can find the relevant information in our LabTalk Language Reference under our Programming documentation under. The following is a snapshot of some examples:


// Operations within a worksheet --------------
//
// The variable %h always points to currently active page
// In the following I am assuming the active page is a worksheet
//
// Set the value of 3rd element of 1st column to 10
%(%h,1,3)=10;
//
// Get the value of 4th element of 2nd column into a variable
myvar = %(%h, 2, 4);
// print value of myvar assigned above
myvar =;
//
// Set values of all rows of 1st column to myvar
%(%h,1) = myvar;
//
//
// Operations between worksheet -------------
//
// Load names of two worksheets into variables
%a=Data1;
%b=Data2;
// In practical situations, these names could be assigned to such
// variables via some user input such as a dialog, so that then
// the code is general and is not tied to specific names
//
// Set (wks2, 2nd col) = 3 * (wks, 1st col)
%(%b, 2) = 3 * %(%a, 1);
//
//
// One can of course use hard coded names and write code such as:
//
// Set 3rd element of 2nd col of data1 wks to 10
data1_a[3] = 10;
//
// Set 2nd col of data2 wks to be 3 times 1st col of data1 wks
data2_b = 3 * data1_a;
//
// But using absolute names like above is not good because
// then the script will not work in general for many situations
//



I would also point to some nice sites put up by some of our power users such as:
http://www.nmrtools.com/labtalk/index.html
http://www.genevalake.ca/origin/labtalk_handy.html

Easwar
OriginLab

Charles.A.1 Posted - 12/03/2004 : 9:27:28 PM
Good question. Too bad the info is not here.
anvogt Posted - 07/23/2004 : 05:24:33 AM
oops- there was another bug in my script, now it works.
problem solved!

Hi,
how do I address data (individual values) of different worksheets?
E.g. I want to multiply a value in woksheet Data1 with a value in worksheet Data2 and place the result in a third worksheet Data3.

Thank you,
Andreas
[/quote]
anvogt Posted - 07/23/2004 : 05:22:54 AM
quote:

Hi,
how do I address data (individual values) of different worksheets?
E.g. I want to multiply a value in woksheet Data1 with a value in worksheet Data2 and place the result in a third worksheet Data3.

Thank you,
Andreas


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