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 column values through script window

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
amorris Posted - 10/04/2005 : 1:06:40 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System: WinXP

Hi everybody,

How can I "set column values" by using the script window? Say I want col(C)=col(B)+col(A). If I do this with the script window, the operation completes successfully, but the column doesn't remember the operation. I want the equation to stay so that in the future if I want to update the column C I can just go to "set column values" dialogue box and update it from there. Can I do this?

Thanks,

Alexis
7   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 11/22/2006 : 07:08:01 AM
Sorry, not possible without Origin C.

Mike Buess
Origin WebRing Member
lanrus Posted - 11/22/2006 : 06:56:35 AM
Hi,

Does somebody know, how do the topic task in Origin 6.5 without Origin C?
easwar Posted - 10/04/2005 : 4:34:30 PM
Hi,

You can also just drag and drop the file to move it from the User folder to the System folder in Code Builder Tree on the left pane.

Easwar
OriginLab

Mike Buess Posted - 10/04/2005 : 4:30:13 PM
Hi Alexis,

1. Right click on your C-file in the Origin C Workspace and select Remove.

2. Right click on the System folder and select Add Files.

3. Locate your file in the browser and add it to the System folder.

4. Select Tools > Rebuild All to compile. From now on it will compile automatically when you start Origin.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/04/2005 4:32:00 PM
amorris Posted - 10/04/2005 : 4:18:34 PM
Hi Mike,

I'm new to origin C, so the link that you posted to one of your previous posts was very helpful. I was wondering though, do you have to recompile the function everytime you open up a new origin session? That setformula function is very useful, and I'd like to be able to use it all the time in the script window.

Thanks,

Alexis
amorris Posted - 10/04/2005 : 3:30:48 PM
Thanks Mike, that's exactly what I needed to know

Alexis
Mike Buess Posted - 10/04/2005 : 1:42:24 PM
Hi Alexis,

You need Origin C to change the "Set Column Values" formula. The following OC function will provide general access to a column formula in labtalk.

void setformula(string strColName, string strFormula)
{
Worksheet wks = Project.ActiveLayer();
wks.Columns(strColName).SetFormula(strFormula);
wks.Columns(strColName).ExecuteFormula();
}

Add it to your CodeBuilder workspace, compile and then use it in labtalk like this...

setformula C col(A)+col(B);

The first argument names the column for which you want to set the formula and the second argument is the formula itself.

If you need instructions for adding a function to CodeBuilder's workspace see my second post in this earlier topic...
http://www.originlab.com/forum/topic.asp?TOPIC_ID=4248

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/04/2005 1:49:24 PM

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