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
 Forum for Origin C
 Sorting a worksheet

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
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.


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