@Sammy,
Muchas gracias for the sort and CompareLines() improvements!
Especially a reliable sort is very important to me.
@All,
Contrary to what the TSE
read.me says, the syntax of CompareLines() is:
Syntax: integer CompareLines( integer line1,
integer line2 [ ,
integer flags [ ,
integer buffer1 [ ,
integer buffer2 ]]] )
line1 and line2 are the numbers of the lines to compare.
flags is optional and can be
_DEFAULT_, _IGNORE_CASE_, _FILTER_SPACES_, _DESCENDING_,
or any of them combined by the bitwise-or "|".
For example, use flags _IGNORE_CASE_|_DESCENDING_|_FILTER_SPACES_
to change all of CompareLines()' default options.
_IGNORE_CASE_ and _DESCENDING_ work like they do in Sort().
_IGNORE_CASE_ makes CompareLines() ignore the difference between
upper and lower case letters.
_FILTER_SPACES_ makes CompareLines() equal any sequence of spaces
and tab characters with any other sequence of spaces and tab
characters.
For example, with the _FILETER_SPACES_ flag,
"A B C"
in line1 will equal
"A B" + Chr(9) + " C"
in line2.
_DESCENDING_ will compare the two lines in the reverse order.
Just like it will make Sort() sort in the reverse orden.
Technically it will multiply CompareLines' default result by -1.
buffer1 and buffer2 are optional and respectively indicate from
which buffers to compare line1 and line2.
If either is omitted then the current buffer is used.
For example, CompareLines(1, 2, _DEFAULT_, 50) compares line 1
from buffer 50 with line 2 from the current buffer.
Returns: Default:
-1 if line1 has a lower order than line2,
0 if line1 and line2 have equal order,
1 if line1 has a higher order than line 1.
This is very comparable with how the Sort() statement works.
Carlo