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