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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 linking columns directly to vectors
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bnahir

USA
Posts

Posted - 09/14/2006 :  4:09:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: Windows XP

I have a hopefully easy question about vectors, datasets, and columns. I want to manipulate the data from a column in a worksheet without changing the original data. Currently, the only way I know to do this is to attach the column to a dataset then set a vector equal to the dataset. While this works just fine, it seems to be a waste of memory. So my question is whether it is possible to directly extract the data from a column and store it in a vector or if this intermediate step is absolutely necessary.

Thanks,
Ben

Deanna

China
Posts

Posted - 09/15/2006 :  01:25:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Usually, there are two ways to get the data from a column and put it in a vector. If the vector is defined in either way, the changes the vector will affect the column in the worksheet.

1.

Worksheet wks=Project.ActiveLayer();
Column col(wks, 1);
vector v(col);


2.

Worksheet wks=Project.ActiveLayer();
Dataset dsB(wks,1);
vector vB( dsB, FALSE ); // Copy Dataset dsD to vector vD removing missing values


Deanna
OriginLab GZ Office
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000