About: API sort   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

From TableLibraryTutorial of lua-users.org. table.sort(table [, compFunc]) sort(table[, compFunc]) Sort the elements of a table in-place (i.e. alter the table). > t = { 3,2,5,1,4 } > table.sort(t) > = table.concat(t, ", ") -- display sorted values 1, 2, 3, 4, 5 If the table has a specified size only the range specified is sorted, e.g., > t = { 3,2,5,1,4 } > table.sort(t, function(a,b) return a = table.concat(t, ", ") 1, 2, 3, 4, 5

AttributesValues
rdfs:label
  • API sort
rdfs:comment
  • From TableLibraryTutorial of lua-users.org. table.sort(table [, compFunc]) sort(table[, compFunc]) Sort the elements of a table in-place (i.e. alter the table). > t = { 3,2,5,1,4 } > table.sort(t) > = table.concat(t, ", ") -- display sorted values 1, 2, 3, 4, 5 If the table has a specified size only the range specified is sorted, e.g., > t = { 3,2,5,1,4 } > table.sort(t, function(a,b) return a = table.concat(t, ", ") 1, 2, 3, 4, 5
dbkwik:wowwiki/pro...iPageUsesTemplate
abstract
  • From TableLibraryTutorial of lua-users.org. table.sort(table [, compFunc]) sort(table[, compFunc]) Sort the elements of a table in-place (i.e. alter the table). > t = { 3,2,5,1,4 } > table.sort(t) > = table.concat(t, ", ") -- display sorted values 1, 2, 3, 4, 5 If the table has a specified size only the range specified is sorted, e.g., > t = { 3,2,5,1,4; n=3 } -- construct a table with user size of 3 > table.sort(t) -- sort will be limited by user size > = table.concat(t, ", ") -- only specified size is concatenated as well 2, 3, 5 Warning: Setting the range of the sort is no longer possible since table.setn is no longer supported (setting n=3 will not set the size of the table to 3) Yssaril 05:31, 23 March 2008 (UTC) A comparison function can be provided to customise the element sorting. The comparison function must return a boolean value specifying whether the first argument should be before the second argument in the sequence. The default behaviour is for the < comparison to be made. For example, the following behaves the same as no function being supplied: > t = { 3,2,5,1,4 } > table.sort(t, function(a,b) return a = table.concat(t, ", ") 1, 2, 3, 4, 5
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software