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
 Delete/insert rows

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
kemeyer Posted - 08/06/2009 : 08:38:39 AM
Origin Ver. 7 and Service Release (Select Help-->About Origin):
Operating System: XP

Can you delete and insert rows? I know you can do that with the columns because you can delete a dataset, but how do you manipulate things in rows? If you can't insert/delete rows, can you insert/delete a single cell so that could be done across multiple columns to make it a row?

Thanks,
Katie
1   L A T E S T    R E P L I E S    (Newest First)
Shirley_GZ Posted - 08/07/2009 : 01:44:13 AM
Hi Katie,

(1)To delete the specified rows of all columns, you can use the LabTalk command mark -d, please see the example.
range bb = col(2)[10:20];
mark -d bb;//deletes row index 10 to row index 20 from the current worksheet

You also can delete every nth rows in the current worksheet, please open the following page to see the examples. http://wiki.originlab.com/~originla/howto/index.php?title=QuickHelp:How_do_I_delete_every_nth_row_or_column_from_my_worksheet

Besides, you can use the oc function deleterow to perform this project. For example,
// First worksheet in project should have 12 rows of data to see effect
int    Worksheet_DeleteRow_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return -1;
 
    Worksheet wks(wp.GetName());
    return (int)wks.DeleteRow(11);
}

(2)To insert a row to the current worksheet, you can use this oc function, insertrow. For example,
// First worksheet in project should have 12 rows of data to see effect
int    Worksheet_InsertRow_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return -1;
 
    Worksheet wks(wp.GetName());
    return (int)wks.InsertRow(10);
}

Any problem, please contact with us freely.

Best regards,
Shirley

Originlab Technical Service Team

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