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
 LabTalk Forum
 How to move the columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

A.Granzhan

Germany
2 Posts

Posted - 09/12/2002 :  12:07:26 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello everybody...

Does anybody know how to program in LabTalk moving the columns in a workshet? I need the same action as menu command "Column -> Move to First/Last".

Thanks a lot in advance.

A. Granzhan
Universität Regensburg

Mike Buess

USA
3037 Posts

Posted - 09/12/2002 :  12:33:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
These scripts will move the third column of the active worksheet to the beginning or end...

# Move to First
%A=wks.col3.name$; // get the name of column 3
wo -i 0; // insert a column at the beginning
copy col(4) col(1); // copy contents of column 4 (was col 3) to the first column
del col(4); // delete column 4
wo -n 1 %A; // rename the first column

# Move to Last
%A=wks.col3.name$; // get the name of column 3
wo -i wks.ncols; // add a column at the end
copy col(3) wcol(wks.ncols); // copy contents of column 3 to the last column
del col(3); // delete column 3
wo -n wks.ncols %A; // rename the last column

Hope that helps.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 09/12/2002 4:28:04 PM
Go to Top of Page

A.Granzhan

Germany
2 Posts

Posted - 09/13/2002 :  04:55:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot, this is what I needed.

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