| Author |
Topic  |
|
|
anvogt
Germany
Posts |
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 |
|
|
anvogt
Germany
Posts |
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
|
 |
|
|
anvogt
Germany
Posts |
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] |
 |
|
|
Charles.A.1
USA
9 Posts |
Posted - 12/03/2004 : 9:27:28 PM
|
| Good question. Too bad the info is not here. |
 |
|
|
easwar
USA
1965 Posts |
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
|
 |
|
| |
Topic  |
|
|
|