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
 Forum for Origin C
 Sorting a worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bucelot

USA
3 Posts

Posted - 07/11/2002 :  10:37:05 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm confused with the documentation on how to sort an active worksheet. Does anyone out there have a simple snippet of code they wouldn't mind sharing to perform this task? Thanks in advance!

bucelot

USA
3 Posts

Posted - 07/11/2002 :  1:45:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Tech support said there is no such command to perform the same operation that you can do in the GUI.

Go to Top of Page

CStorey

Canada
137 Posts

Posted - 07/11/2002 :  1:48:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In Origin 7.0 you can use the sort LabTalk command. From the Help file:

sort -c c1 c2 datasetName

Sort the current worksheet in ascending order between columns c1 and c2, inclusive, against the specified dataset within the worksheet. Row integrity is maintained among the specified columns.



Craig Storey
Origin WebRing Member - http://g.webring.com/hub?ring=originwebring

Edited by - CStorey on 07/11/2002 13:49:04
Go to Top of Page

bucelot

USA
3 Posts

Posted - 07/11/2002 :  2:50:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks!

Go to Top of Page

easwar

USA
1965 Posts

Posted - 07/11/2002 :  2:53:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

There is currently no method in worksheet class in Origin C to sort a worksheet. But you could access the worksheet object using LabTalk from within an Origin C program with code like below:

void dd()
{
_LT_Obj
{
sort.wksname$="Data1";
sort.c1=0; // sort all columns
sort.r1=1; // sort from row 1
sort.r2=10; // sort to row 10
sort.cname1$="D: B"; // sort descending on col B
sort.wks();
}

}

Easwar
OriginLab.
Go to Top of Page

member1

USA
3 Posts

Posted - 07/11/2002 :  10:36:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Edited by - member1 on 07/12/2002 09:12:48

Edited by - member1 on 07/12/2002 09:14:25
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