sorting SQLite keys where no leading zeros at end of name
bonnmike at gmail.com
Thu Jun 4 18:52:32 EDT 2015
You can do this.
-- my field has sample data based on your example
put field "myfieldWithData" into tData
sort lines of tData ascending numeric by numberTag(each)
-- tData now contains your sorted keys, do with them as you wish.
function numberTag pVar
-- returns the number portion of the line as the sort key
return char (offset("_",pVar) + 1) to -1 of pVar into tTest
On Thu, Jun 4, 2015 at 4:36 PM, Dr. Hawkins <dochawk at gmail.com> wrote:
> I have keys that get generated such as
> I just hit the snag that someKey_10 comes between the two of these.
> Is there a clean way to get SQLite (in memory) to ORDER these numerically
> without having to recode to force leading zeros?
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the Use-livecode