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
 Set equation for set column value + auto update

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
JBrueckner Posted - 05/27/2014 : 08:24:36 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.6.0G
Operating System: Win7

Hello,

I wrote a Labtalk script where I import two columns of data from a csv, after which I calculate col(C) from col(a) and col(b).
I execute the script by typing "run imp.ogs" in the command window.
The following script works fine:

newbook dataimport; 
wks.ncols=2;

impCSV fname:="H:/data.csv" options.decimal:=1 options.HeaderLines.SubHeaderLines:=1 options.HeaderLines.LongNames:=1;

page.active=1;
wks.name$=rawdata;
wks.colwidth = 2;

%A = "dataimport"; 
window -r %H %A;

//copy data 1st data set
newsheet name:=data0 cols:=2;
wks.labels(LUCD1);
page.active=1;
colcopy irng:=(1:2) orng:=[dataimport]data0!(1:2) data:=1 format:=1 lname:=1 units:=1 comments:=1;
page.active=2;wks.colwidth = 3;

col(C) = col(B)/col(A)*100;


However it doesn't show the equation for col(c) when I right-click on col(c) and go to set value...
I want col(c) to update automatically and remember the equation when I manually add new lines to col(a) and col(b).
How is that possible?

Thank you very much,
Jan
2   L A T E S T    R E P L I E S    (Newest First)
JBrueckner Posted - 05/27/2014 : 11:33:43 AM
Hello Zheng,

thank you very much for your quick responds.
Your solution works great!

Thank you very much,
Jan
lkb0221 Posted - 05/27/2014 : 09:49:47 AM
Hi,

To keep the formula and create green lock for auto update, you need to use the following X-function:
http://www.originlab.com/doc/X-Function/ref/csetvalue

Zheng
OriginLab

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