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
 C function that flips columns (how to modify)

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
marasneo Posted - 04/23/2015 : 12:59:22 PM
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);
}
}
1   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 04/24/2015 : 12:07:07 PM
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

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