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
 LabTalk Forum
 Labtalk and Columns moving

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
cheyenne Posted - 01/30/2005 : 1:12:45 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System: Win XP

I spent the whole afternoon trying to write down a labtalk script that moves columns (dataset,labels and names) leftwards and rightwards, in the same way the column toolbar buttons do, but I couldn't make it...
I'm desperate..this is part of a bigger script I'm writing in order to manipulate a complex worksheet produced by the experimental setup used in the lab. Besides, do you know how to access the code behind all the toolbar buttons and menu commands (labtalk or/and Origin.c)?
I hope somebody can help me...I'm sure there must me a way to do it, simply I didn't get it!...
4   L A T E S T    R E P L I E S    (Newest First)
razva Posted - 06/26/2007 : 2:19:15 PM
Although it is too late to reply to this, I am posting the script I have written to move columns in the worksheet, together with the labels and values. Maybe it will be useful for people searching the archives like I have done.

The script is manipulating the columns to arrange them in the reverse order into worksheet i.e. columns A to Z will be re-arranged Z to A. Additionally, one can keep the first column fixed as this is in general storing the independent variable. It goes like this:


aa=wks.ncols; // read the total number od columns in the active woks
//type $(aa); // check how many columns u have in the worksheet
for(ii=aa-1; ii>1; ii--) // make the variable to decrease
{
wks.colsel($(ii),1); // select columns one by one starting with the aa-1 (if aa-th column should be in front,
//all the others will have to move relative to this one)
// ii==2 or ii>1 is the condition to stop before applying the script to the first column in the wks
menu -e 38773 ; // this is the menu command to move a selected column to the end of wks
wks.colsel($(aa),0); // unselect the column that was just moved to be able to select a new one at the next iteration
}
// apply the script twice to undo the operation




Mike Buess Posted - 01/31/2005 : 07:37:36 AM
It turns out that the MoveColumns function doesn't work in Origin 7.5 even though it appears in the Programming guide. So the only way to move columns now is by executing the appropriate menu command. If you checked the link I gave you then you can find out that the menu ID for the Move Column to First command is 38772. Therefore, to move the fourth column to first you can do this...

wks.colsel(4,1);
menu -e 38772;

Mike Buess
Origin WebRing Member
cheyenne Posted - 01/31/2005 : 03:06:44 AM
Thank you very much Mike, I'll have a look at the Origin C manual then, although i'm a real beginner with it!...
Mike Buess Posted - 01/30/2005 : 1:50:23 PM
quote:
...a labtalk script that moves columns (dataset,labels and names) leftwards and rightwards
There's no LabTalk command for that but in Origin C you can use Worksheet::MoveColumns.
quote:
do you know how to access the code behind all the toolbar buttons and menu commands (labtalk or/and Origin.c)?
http://www.nmrtools.com/labtalk/i_menu.html

Mike Buess
Origin WebRing Member

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