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 in different worksheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

anvogt

Germany
Posts

Posted - 07/23/2004 :  03:43:54 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

anvogt

Germany
Posts

Posted - 07/23/2004 :  05:22:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Go to Top of Page

anvogt

Germany
Posts

Posted - 07/23/2004 :  05:24:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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]
Go to Top of Page

Charles.A.1

USA
9 Posts

Posted - 12/03/2004 :  9:27:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Good question. Too bad the info is not here.
Go to Top of Page

easwar

USA
1965 Posts

Posted - 12/03/2004 :  10:18:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

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