bubble sort

for emergency use only

suitable for lists of up to 10 ot 15 items, very slow for large lists



	list of 'n' items



	repeat this 'n' times


		smallest_item_value = -100	// any value smaller than the smallest item in the list

							// may be a text string in some applications, e.g surname 'aaaa'

		smallest_item_entry = 0
	

		for each item in the list, entry number being entry number j


			if this_entry_item_value < smallest_item_value then

				smallest_item_value = this_entry_item_value

				smallest_item_entry = j

			endif

		next

	
		copy item 'smallest_item_entry' to the end of the new list
	
		remove item 'smallest_item_entry' from the list or tag it to be ignored in the scan

	end repeat




	
