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
 Forum for Origin C
 sum two columns to another

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
bubbas Posted - 10/12/2006 : 07:59:40 AM
Origin Version (Select Help-->About Origin): 7.5E
Operating System: WIN XP

Hi,

i'm new to OriginC & have a question.

I have a worksheet with different columns. Now i want to take lets say the column labeled "A" and a secon one "B". I want to create a new worksheet with a specific name and put there a column with the name "C" which contains the result of A+B lets say.

I have tried around but was not able to put the data of a Dataset to a column and the column to the worksheet :(

hope somebody can help me!

thanks

bubbas

Edited by - bubbas on 10/12/2006 08:00:46 AM
4   L A T E S T    R E P L I E S    (Newest First)
bubbas Posted - 10/12/2006 : 11:55:17 AM
thanks, thanks :) it works!!!

ciao

bubbas
zachary_origin Posted - 10/12/2006 : 10:53:28 AM

void AddTwoCols()
{
Worksheet wks = Project.ActiveLayer();
Worksheet wks2;
wks2.Create();

Dataset dsColA(wks,0);
Dataset dsColB(wks,1);
Dataset dsColAA(wks2,0);
Dataset dsColBB(wks2,1);
if( wks2.Columns.Count()==2 )
wks2.AddCol();
Dataset dsColCC(wks2,2);
dsColAA = dsColA;
dsColBB = dsColB;
dsColCC = dsColA + dsColB;
wks2.GetPage().Rename("WorksheetName");
wks2.Columns(2).SetName("ColumnNameHere");
}


Zachary
OriginLab Technical Services.
bubbas Posted - 10/12/2006 : 09:38:36 AM
hey thank you very much zachary!

my problem is more the creation of a new worksheet with a specific name. then inserting there the ColC also with a specific name. i don't want to change the original worksheet containing colA and colB.

Thx in advance!

vale

Edited by - bubbas on 10/12/2006 09:43:43 AM
zachary_origin Posted - 10/12/2006 : 09:19:11 AM
you can learn from the examples in Origin:Help: Progamming: Origin C Language Reference: Composite Data Type: Dataset to see how to manipulate the columns.
Here is a simple example as your requirment:
void AddTwoCols()
{
Worksheet wks = Project.ActiveLayer();
Dataset dsColA(wks,0);
Dataset dsColB(wks,1);
if( wks.Columns.Count()==2 ) wks.AddCol();
Dataset dsColC(wks,2);
dsColC = dsColA + dsColB;
}





Zachary
OriginLab Technical Services.

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