I think you have to append “of each”. Sort lines of tVar by item 3 of each
Bob S > On Aug 30, 2023, at 9:11 PM, Neville Smythe via use-livecode > <use-livecode@lists.runrev.com> wrote: > > There is a bug in sorting a container using a function, as in > > sort lines tVariable by myVal(each) > > where the function is for example > > function myVal pStr > return item 1 of pStr + item 2 of pStr > end myval > > If the function myVal encounters a run-time error (in the example if one of > the items is not a number) the sort command fails silently: the script exits > at that code line and the user is unaware that the sort (and the rest of the > handler) were not executed. > > If you sort directly with > > sort lines tVariable by (item 1 of pStr + item 2 of pStr) > > the handler will throw an error dialog, as expected. > > QC has confirmed this is a bug ( bug 24321 > <https://quality.livecode.com/show_bug.cgi?id=24321> ) that evidently has > been around for a long time. > > Neville Smythe > > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode