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
 User defined parameter in the Results sheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Simpa

4 Posts

Posted - 03/16/2014 :  6:41:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5.0 SR1
Operating System: Win7 x64

Hi,

after running batch peak analysis on multiple books with data (Analysis -> Peaks and Baseline -> Batch Peak Analysis Using Theme) I got the result sheet.
Now I would like to add a new column with values of the parameter that I defined when I was importing the raw data into Origin.
I tried with Set Column Values. I can reach my parameter through Variables -> Insert Info Variable which results in "int n1 = [Book1]!page.info.File1.Variables.Header.pressurePa;" line in Before Formula Scripts window. "n1" is now my parameter from book1, but there are many books and "n1" should change accordingly. There is the Range string in the result's Dataset column and probably I should use this information but I don't know how.

Maybe there is an easier way to achieve that?

I would really appreciate your help.

Simpa

4 Posts

Posted - 03/17/2014 :  11:24:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I was dealing with this for hours and this is what I found out so far:
In the first column I have strings similar to that one:

[Book1]Take1_tre!(m"Mass",p"Pressure")

where book index is changing.

The link to my parameter I want to include into the sheet is:

[Book1]!page.info.File1.Variables.Header.pressurePa

My idea is to make a new string with the [Book1] part from the first column and "!page.info.File1.Variables.Header.pressurePa" part from my parameter link. This new string would be the right link to my parameter.


//Before Formula Scripts in Set Values window
dataset dsBook = Left(wcol(1),Find(wcol(1),"]"))$;
string str1$ = "!page.info.File1.Variables.Header.pressurePa";


How can I join those two strings and tell Origin to read it as a link? I tried several things but nothing seems to work.

Thanks for your help.
Go to Top of Page

lkb0221

China
497 Posts

Posted - 03/18/2014 :  12:05:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

To join two strings, you can use "+" operatiion, for example:
//
str1$ = A;
str2$ = B;
str3$ = str1$ + str2$;
str3$ = ; // Will return AB
//

To link cells by range string, use Cell://, for example:
//
str$ = "cell://[book1]sheet1!col(B)[3]";
cell(1,1)$ = str$; // link the first cell in current wks to [book1]sheet1!col(B)[3]
//

Zheng
OriginLab

Edited by - lkb0221 on 03/18/2014 4:43:21 PM
Go to Top of Page

Simpa

4 Posts

Posted - 04/20/2014 :  06:24:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks lkb0221,

that's what I was looking for.
Meanwhile I have already found a workaround that is almost identical to this topic (in case somebody is interested).
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