Google bubble sort, or sorting algorithm. Since you're using JASS, implementing say a C++ algorithm would be a simple case of copy & paste & fix syntax.
If you want to code it yourself, here's the method:
1. Set a test value = 0.
2. Loop through 1 to array end, checking if array element is > test value.
3. If yes, set test value to array element, and record array number in another integer.
4. At the end of the loop, set array[1] = test value.
5. Repeat 1-4, now looping instead from 2 to array end.
At most you'll have to loop the main loop the number of times equal to the array size, but I suggest you rather make it a function that will call itself if it detects that the array isn't sorted (the array is sorted if test value = 0 after the loop)