| T O P I C R E V I E W |
| bucelot |
Posted - 07/11/2002 : 10:37:05 AM 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!
|
| 5 L A T E S T R E P L I E S (Newest First) |
| member1 |
Posted - 07/11/2002 : 10:36:56 PM Edited by - member1 on 07/12/2002 09:12:48
Edited by - member1 on 07/12/2002 09:14:25 |
| easwar |
Posted - 07/11/2002 : 2:53:06 PM 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. |
| bucelot |
Posted - 07/11/2002 : 2:50:13 PM Thanks!
|
| CStorey |
Posted - 07/11/2002 : 1:48:49 PM 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 |
| bucelot |
Posted - 07/11/2002 : 1:45:17 PM Tech support said there is no such command to perform the same operation that you can do in the GUI.
|