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
 Delete/insert rows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kemeyer

39 Posts

Posted - 08/06/2009 :  08:38:39 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Shirley_GZ

China
Posts

Posted - 08/07/2009 :  01:44:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - Shirley_GZ on 08/07/2009 02:05:56 AM
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