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
 Deleting columns.

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
sabpalazzese Posted - 01/17/2021 : 07:18:17 AM
Hello everyone,

I'm trying to delete all empty columns at once using labtalk. I was trying to define a range selecting by hand the empty columns and then deleting the range. However the columns are not always the same and this is a lot of work.

Is there a way that I can easily do this using the command or script window?

Thanks in advance.
3   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 01/21/2021 : 07:16:02 AM
We added LabTalk access as wks.MaxCols, maybe you would like to try in a beta? code will look like


range rr=$(wks.maxcols+1):$(wks.ncols);
del rr;


CP
sabpalazzese Posted - 01/21/2021 : 04:48:25 AM
Thank you very much, however, when I try using this code in Origin C it doesn't compile. I have never used Origin C so maybe I am doing something wrong. I will read the user guide and try again.
cpyang Posted - 01/17/2021 : 2:50:27 PM
I am afraid there is no LabTalk access for finding the first empty column from the end, but there is Origin C access, like this

	Worksheet wks = Project.ActiveLayer();
	int nCols = wks.GetNumCols();
	int n1 = wks.FindFirstEmpty(0, true);
	wks.DeleteCol(n1, 0, nCols-n1);


We can add this to LT wks method, as it is also available in automation server, so it is simple to add this to LT and thus can be used from Python.

CP

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