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 |