News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

nrQsortA

Started by Farabi, May 18, 2010, 01:09:14 AM

Previous topic - Next topic

Farabi

Can I sort a list of text terminated by CRLF?
Or I need to create the text table?
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

dedndave

C:\>type unsort.txt|sort.exe>sort.txt :bg

Farabi

Quote from: dedndave on May 18, 2010, 02:54:18 AM
C:\>type unsort.txt|sort.exe>sort.txt :bg

:lol
I want to include it on my program, not using a third party one.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

hutch--

Onan,

Yes you can sort text which has CRLF pairs at the end of each sentence. Most string sorts sort arrays of strings so they do compares until either a miswmatch or a zero.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Farabi

Quote from: hutch-- on May 18, 2010, 06:09:42 PM
Onan,

Yes you can sort text which has CRLF pairs at the end of each sentence. Most string sorts sort arrays of strings so they do compares until either a miswmatch or a zero.

So you mean I need to list all of the words using CFLF first before Im using nrQsortA?
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

hutch--

Onan,

Have a look at these two procediures in the MASM32 library.


assort proc arr:DWORD,cnt:DWORD,rdi:DWORD ; ascending version
dssort proc arr:DWORD,cnt:DWORD,rdi:DWORD ; descending version


They are documented in the masm32 library help file and are reasonably straight forward to use. IMPORTANT, read the reference material in the help file and do not construct an array of strings that have NULL pointers in any of the array members, otherwise filter the NULL pointers out BEFORE you sort the array.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php