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
 Origin Forum
 Storing general info about worksheet

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
AKazak Posted - 09/02/2020 : 10:08:44 AM
OriginPro 2021 (64-bit) Beta 4 9.8.0.138
Windows 7 Pro x64 SP1

Greetings!

I import an instrument text-file log where extract general info such as Start Date and Start Time from file header to variables with Add variable to page info and Create User Parameter rows for each variable options turned on (ticked).

Add variable to page info works fine but adds the variable to workbook metadata, but not to worksheet's metadata.
Create User Parameter rows for each variable options turned on also works as expected, but adds Column Label Rows filled with the same values for all the columns.

What is the best place to store general variables pertaining to the whole worksheet?
How do I access these variables in Formula of Set Values dialogs?

Thank you.

---
Andrey
5   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 09/02/2020 : 1:59:56 PM
Chris,

Thank you.
I've written a three-line LT script after import that copies extracted variables from USER.VARIABLES to the target sheet node. Very easy and straightforward.

How do we set a node type (Numeric, Text or Branch) or delete it via LT?


---
Andrey
Chris D Posted - 09/02/2020 : 1:44:19 PM
From our Labtalk scripting guide (https://www.originlab.com/doc/LabTalk/guide):

Worksheet


// Here we add two trees to the active sheet
wks.tree.add(Input);

// Dynamically create a branch and value
wks.tree.input.Min=0;

// Add another value
wks.tree.input.max=1;

// Add second tree
wks.tree.add(Output);

// and two more values
wks.tree.output.min=-100;
wks.tree.output.max=100;

// Now dump the tree
wks.tree.=;

// or access it
ty Input $(wks.tree.input.min)to $(wks.tree.input.max);
ty Output $(wks.tree.output.min)to $(wks.tree.output.max);

// Access a sheet-level tree using a range
range rs =[Book7]Sheet2!;
rs!wks.tree.=;

Column

// Create a COLUMN tree
wks.col2.tree.add(Batch);

// Add a branch
wks.col2.tree.batch.addsection(Mix);

// and two values in the branch
wks.col2.tree.batch.mix.ratio$="20:15:2";
wks.col2.tree.batch.mix.BatchNo=113210;

// Add branch dynamically and add values
wks.col2.tree.batch.Line.No=7;
wks.col2.tree.batch.Line.Date$=3/15/2010; 

// Dump the tree to the Script Window
wks.col2.tree.=;

// Or access the tree
batch =wks.col2.tree.batch.mix.batchno;
string strDate$=wks.col2.tree.batch.Line.Date$;
ty Batch $(batch)made on %(strDate$)[$(date(%(strDate$)))];


This should give you enough to work with.


Thanks,
Chris Drozdowski
Originlab Technical Support
AKazak Posted - 09/02/2020 : 12:01:22 PM
quote:
Originally posted by YimingChen

You can extract the variables and save as column header and access those variables later. Please check this page on accessing column header row variables.
https://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata#Column_Label_Rows

James



Currently, I extract the variables and save toe Column Label Rows and access them using Col(n)[Dm]$;.
But I don't like that Create User Parameter rows for each variable fills Column Label Rows with the same values for all the columns.

quote:
Originally posted by lkb0221

You can also access the workbook/worksheet user tree to store/read values by LabTalk commands. See the documents here:
https://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata#User_Tree_in_a_Worksheet


OK. The worksheet tree seems to be an appropriate way of storing general worksheet properties.
How do I extract variables to the sheet tree on text-file import?
How do I access tree branches from Set Values dialog?

---
Andrey
lkb0221 Posted - 09/02/2020 : 10:54:22 AM
You can also access the workbook/worksheet user tree to store/read values by LabTalk commands. See the documents here:
https://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata#User_Tree_in_a_Worksheet
YimingChen Posted - 09/02/2020 : 10:47:29 AM
You can extract the variables and save as column header and access those variables later. Please check this page on accessing column header row variables.
https://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata#Column_Label_Rows

James

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