Can I sort a list of text terminated by CRLF?
Or I need to create the text table?
C:\>type unsort.txt|sort.exe>sort.txt
:bg
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.
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.
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?
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.