This code starts at the second array element, and checks to see if its value is less than the one above it. If so, it swaps its value with the one above it. It then moves onto the third array elements and checks to see if it is less than the second and so on.
Repeat Moved = False ; Presumes ints are in an array where the first int is in array position 0, and the last in array position TOTAL_INTS-1 For Loop = 1 to TOTAL_INTS-1 If Integers(Loop) < Integers(Loop-1) Temp = Integers(Loop) Integers(Loop) = Integers(Loop-1) Integers(Loop-1) = Temp Moved = True Endif Next Until Not Moved