sort bug
neville.smythe at optusnet.com.au
neville.smythe at optusnet.com.au
Sat Sep 2 20:18:18 EDT 2023
Geoff Canyon wrote (after a bravura display of how many different
ways there are to do things in LC!) :
And the function sort also sorts based on a negative infinity value
for
errors. I'm not sure I'd consider that a bug.
Hmm. I would. The sortKey function should tolerate any sort of
run-time error? But anyway that's not the issue. The bug I see is that
the sort command exits its containing handler - actually I presume the
sortKey function exits to top - without throwing an error, so nothing
beyond that line is executed. This creates a very difficult problem
to track down, since the code appears to be executing correctly, until
something falls over or a file gets corrupted much later because some
stuff never happened.
Of course one should always validate data, particularly if it's not
your own data. In this case it was my own data! Moreover I had thought
I had checked for invalid cases, just hadn't checked all possible
kinds of invalid data (the sortKey was rather more complicated than
the one I used for illustration).
Neville
-------------------------
Email sent using Optus Webmail
More information about the use-livecode
mailing list