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!
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.
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(); }