Liberty BASIC Help Online

Sorting Arrays
Liberty BASIC provides a built-in sorting command for arrays.  Here is an example:
  'sort 100 numbers
  dim numbers(100)
  for x = 0 to 99
    numbers(x) = int(rnd(1)*100)
  next x
  sort numbers(), 0, 99  'sort items 0 through 99
  for x = 0 to 99
    print numbers(x)
  next x
Double dimensioned arrays can also be sorted.  To do so, it is necessary to add an extra parameter to the command to specify the column:
  'sort by the value in column 2
  sort numbers(), 0, 99, 2
See also: SORT

Copyright (C) 2003 Shoptalk Systems
Liberty BASIC -