Enhanced Sort Macro

Post user created macros to share with others here.

Moderator: Moderators

Enhanced Sort Macro

Postby Bret Sutton on Fri Dec 31, 2004 1:32 pm

:D Did you ever want to do a Multi-Edit sort on more than one field, in mixed ascending/descending order?

:D Did you ever want to sort by date, where the date was in a funky format?

:D Did you ever want to eliminate duplicate records when you sorted? Or do summary sorts?

Have I got a deal for you!

The attached file contains NWSSORT.S the macro and NWSSORT.PDF the documentation. The .S file contains NWS_SortMenu and NWS_TextSort, which are direct replacements for the standard Multi-Edit SortMenu and TextSort macros.

For the newbies, installation instructions:
    > Download, unzip, and save to a good place: C:\MEW\SRC\NWS or some such.
    > Read the documentation. Most of it, anyway.
    > Open NWSSORT.S in Multi-Edit. Compile it: Tools|Execute compiler|Compile CMacWin macro.
    > Change your Text|Sort menu entry to run NWSSort^NWS_SortMenu rather than SortMenu: Tools|Customize|Keys/Commands, do a Search for 'SortMenu', and make the appropriate changes.
    > Or you can try it out before changing your keymap by doing Macro|Run and entering NWSSort^NWS_SortMenu.
Attachments
nwssort.zip
NWSSORT Enhanced Sort Utility and documentation
(59.77 KiB) Downloaded 1190 times
Bret Sutton
COBOL dinosaur
Author of the NWS macro series
User avatar
Bret Sutton
Registered User
 
Posts: 153
Joined: Fri Sep 12, 2003 5:14 am
Location: Seattle

Postby AndyColson on Fri Dec 31, 2004 3:24 pm

... Wow. Just ... wow. That is increadable. Thank you!

-Andy
User avatar
AndyColson
Registered User
 
Posts: 170
Joined: Sat Jul 26, 2003 1:29 pm
Location: Marion, IA

Postby Ken Walker on Tue Jan 04, 2005 4:54 pm

Hey, now this is what ME is all about!!! Way to go Bret!
Ken Walker (MESI)
MCSE
KC9DTP
User avatar
Ken Walker
Developer
 
Posts: 59
Joined: Sun Aug 03, 2003 7:45 pm
Location: Indiana

Postby mbourque on Fri Jan 07, 2005 2:10 am

Very nice - I especially liked seeing my name listed as an example in the documentation. ;)

To see my name listed with Todd and Dan makes me feel famous!
User avatar
mbourque
Registered User
 
Posts: 14
Joined: Tue Aug 19, 2003 3:41 am

Postby shanevincent on Thu May 19, 2005 3:20 pm

I have a question, using MEW 9.1 I seem to not get the "Sort Marked Block Only" switch, (with this macro, not with the normal sort) even when I mark a block.

While I tweaked the file to let me do block editing, now I get the error of
NWSBLOCK.MAC not found.

This seems to be linked to
RM ('NWSBLOCK^PUSH_POP_BLK /A=PUSH/I');
and
RM ('NWSBLOCK^PUSH_POP_BLK /A=POP/I');
Strange.
Shane Vincent
shanevincent
Registered User
 
Posts: 14
Joined: Mon May 24, 2004 4:34 pm

Postby Bret Sutton on Thu May 19, 2005 5:51 pm

Oops! Part of the problem is that the sort macro makes use of several other of the NWS collection of macros. I haven't posted the entire NWS collection in several years. Sorry about that.

The attached zip file includes two additional macro files that should take care of all unresolved NWS macro references. You may want to browse them, as they contain a bunch of interesting macros. I won't discuss them here as that's off-topic.

I don't know why you did not get the "Sort Marked Block Only" switch, but I am very interested in finding out. Could you email me both the sort macro as you corrected it, and your MECONFIG.DB file? (It is in the CONFIG subdirectory of your Multi-Edit program directory.)

Thanks.
Attachments
nwssubset.zip
NWSBLOCK, NWSCURSR macro files
(18.61 KiB) Downloaded 1029 times
Bret Sutton
COBOL dinosaur
Author of the NWS macro series
User avatar
Bret Sutton
Registered User
 
Posts: 153
Joined: Fri Sep 12, 2003 5:14 am
Location: Seattle

Postby shanevincent on Fri May 20, 2005 5:36 pm

Hi Bret,
Unfortunately (for me) now that the sort seems to run, it deletes whatever is sent to it (i.e. the whole file or the block).

The fix (which wasn't a fix) was just to add
sort_block = True; //workaround by Shane
at line 147 in NwsSort.s

That's not a fix, it's just so I could get this running. Sorry I wasn't clearer about what I did, I just was looking at getting something running.
Shane Vincent
shanevincent
Registered User
 
Posts: 14
Joined: Mon May 24, 2004 4:34 pm

Postby deleyd on Mon Apr 03, 2006 12:26 am

I just released my EDX 3.0 package which includes a major overhaul of Bret's NWS Sort. The package is at http://www.multieditsoftware.com/forums/viewtopic.php?t=489

I also added some documentation on using the Sort to the end of file "EDX Documentation.txt" (In file EDX 3.0.ZIP)
User avatar
deleyd
Developer
 
Posts: 1019
Joined: Tue Jul 29, 2003 4:27 pm
Location: Santa Barbara, CA

Postby John Martzouco on Mon Jun 26, 2006 8:54 pm

Hi,

I noticed that when the "Number of characters in sort" vlaue is equal to zero, I get the same result as Shane... all my data disappears after the sort.

If I perform a Column Select, then the "Number..." field has a non-zero entry in it and all is well.

Regards,
John
User avatar
John Martzouco
Registered User
 
Posts: 325
Joined: Fri Jun 09, 2006 1:22 am
Location: Montreal, Canada

Postby Bret Sutton on Wed Aug 30, 2006 5:37 am

Well, darn. Now you've given me a reason to stay up. I'll see what I can dig up. I assume you're using my version of the code, and not David's?

Looks like I didn't properly follow up with Shane, either. Phoo. If I don't get back to you in the next few days, bug me.
Bret Sutton
COBOL dinosaur
Author of the NWS macro series
User avatar
Bret Sutton
Registered User
 
Posts: 153
Joined: Fri Sep 12, 2003 5:14 am
Location: Seattle

Postby Bret Sutton on Wed Aug 30, 2006 9:04 am

Unfortunately, John, I am unable to recreate your problem. I could not solve it for Shane, either, even though he sent me his meconfig.db file. It worked correctly for me every time.

Please send me, directly via email, copies of your meconfig.db, your wcmdmap.db (or whatever command map file you're using), and the macro source file containing my sort macro. I'll give it all another try.

Thanks.
Bret Sutton
COBOL dinosaur
Author of the NWS macro series
User avatar
Bret Sutton
Registered User
 
Posts: 153
Joined: Fri Sep 12, 2003 5:14 am
Location: Seattle

Postby deleyd on Wed Aug 30, 2006 3:11 pm

Here's my overhauled version of Bret's NWS sort. The main routine to call is edx$NWS_SortMenu
Attachments
edxnwsSort.s
(30.63 KiB) Downloaded 1136 times
User avatar
deleyd
Developer
 
Posts: 1019
Joined: Tue Jul 29, 2003 4:27 pm
Location: Santa Barbara, CA

Thanks Brett and deleyd

Postby shanevincent on Wed Oct 04, 2006 5:39 pm

The new sort works great for me.
Shane Vincent
shanevincent
Registered User
 
Posts: 14
Joined: Mon May 24, 2004 4:34 pm


Return to User Created Macros

Who is online

Users browsing this forum: No registered users and 0 guests