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
 how to delete a element of a column

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
kitten_li Posted - 07/30/2006 : 11:37:37 PM
Origin Version: 6.0
Operating System: WinXP

Hi LabTalk experts,
I'm just wondering which command can I use in the
LabTalk script to delete an element of a column.
Just exactly as clicking "Edit->Delete" after
selected/highlighted that cell.

Thanks a lot!
5   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 07/31/2006 : 12:26:25 PM
Easiest way is to select the cell you want to delete and then execute Edit > Delete with the menu -e menuID. This tip describes how to find menuID.

wo -s 1 5 1 5; // select col 1, row 5
menu -e 36442; // Delete

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/31/2006 12:48:53 PM
kitten_li Posted - 07/31/2006 : 11:15:50 AM
Thank you so much Mike.
Your "copy" solution works well only with column containing data of the same type (all elements are numeric or text).
However, if you have a column that is of the "Text&Numeric" type, and
you just want to delete those cells with a certain numeric value, this "copy" solution still has a problem. All the cells with a text content would appear as "-" after running this script.
Do you have any idea about how to solve this problem?

Thank you again!
Mike Buess Posted - 07/31/2006 : 10:19:18 AM
This LabTalk script deletes row nn from col A without changing other columns in the same worksheet...

nn=5; // delete row 5;
get col(A) -e npt; // npt is # rows in col(A)
if( nn>npt ) return;
npt-=1;
copy -b (nn+1) col(A) col(A) -b nn -e npt;
set col(A) -e npt;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/31/2006 10:20:21 AM
kitten_li Posted - 07/31/2006 : 09:46:09 AM
Thank you Deanna for your reply!
However, by using "mark -d", the same
rows of all the columns will be deleted.
Suppose I have col(A) and col(B), how can
I just delete col(A)[1] while keep col(B)[1]
intact?

Thank you very much!
Deanna Posted - 07/31/2006 : 12:28:34 AM
Hi, you may use the following command:
mark -d dataset range

For example, to delete the 4th to 6th cells of Row 2, use the script window:
mark -d col(2) -b 4 -e 6;


Deanna
OriginLab GZ Office

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