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
 C function that flips columns (how to modify)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

marasneo

Poland
9 Posts

Posted - 04/23/2015 :  12:59:22 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,
in one topic I found such function that flips all selected columns.
It works, but only when I select a few columns in one tab in worksheet.
Is it possible to modify this script for selection of a few columns in a number of tabs in the same worksheet?
This is essential for me, also for further scripts.
Maybe the problem is here: Project.ActiveLayer();

void flip_selected_columns()
{
Worksheet wks = Project.ActiveLayer();
vector<int> vv;
wks.GetSelectedColumns(vv);
int nSels = vv.GetSize();
if( !nSels ) return;
for(int ii; ii<nSels; ii++)
{
Dataset dd(wks,vv[ii]);
matrix mm(dd.GetSize(),1);
mm.SetByVector(dd);
mm.FlipVertical();
mm.GetAsVector(dd);
}
}

lkb0221

China
497 Posts

Posted - 04/24/2015 :  12:07:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

What do you mean by "a number of tabs in the same worksheet"? For one worksheet is just one single tab.
To loop through all layers in one page, please see the following doc:
http://www.originlab.com/doc/OriginC/ref/Page-Layers


Zheng
OriginLab
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