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
 Origin Forum
 Sorting columns

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
amyz Posted - 05/27/2005 : 7:52:58 PM
I looked up the script for sorting, and found the following:

sort.wksname$ = Data1; // For the worksheet Data1
sort.c1 = 0; // all columns
sort.r1 = 3; // from row 3 to
sort.r2 = 11; // row 11,
sort.cname1$ = D: B;
// using column B as the primary, sort in descending order
sort.cname2$ = A: A;
// and column A as the secondary, sort in ascending order
sort.wks() // execute sort

I changed 'Data1' in line 1 to the name of my worksheet, but the worksheet doesn't respond when I run the script.

A couple of questions...

- Are the starting & ending row numbers necessary? i.e., do we need the following, or would the default be from the first to the last row if I don't include it?
sort.r1 = 3; // from row 3 to
sort.r2 = 11; // row 11

- In sort.cname1$ = D: B, does it matter if I change 'B' to '2'? [same column 'name'], and what if I change it to what I've actually labelled the column? (e.g. 'y') Right now, I'm not sure of any differences this would make, b/c the worksheet doesn't respond in any case...

Thank you
1   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 05/30/2005 : 2:24:59 PM
Hi,

First of all, the code you posted here is from an example in the LabTalk reference help file, but there is a ; missing in the last line - try changing that line to
sort.wks(); // execute sort
and then highlight all lines of code and hit enter to sort.

As for column name, you need to use the exact column name and not the label or index etc.

Easwar
OriginLab



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