- This wiki is out of date, use the continuation of this wiki instead
Sort
From FenixWiki
(Difference between revisions)
Revision as of 00:11, 12 July 2007
Contents |
Definition
STRING sort ( <VARSPACE array> , [<INT datacount>] )
Sorts an array.
Parameters
VARSPACE array | - The array to be sorted. |
[INT datacount] | - Number of elements to sort. |
Returns
INT: true
Example
Program sorting; Const myarray_length = 10; Global int myarray[myarray_length-1]; Begin // Insert random numbers for(x=0; x<myarray_length; x++) myarray[x] = rand(0,100); end // Show array say("--------------------"); for(x=0; x<myarray_length; x++) say(x + " - " + myarray[x]); end // Sort sort(myarray); // Show array say("--------------------"); for(x=0; x<myarray_length; x++) say(x + " - " + myarray[x]); end // Wait until ESC is pressed Repeat frame; Until(key(_esc)) End