'===========================================================================
' Subject: Simple Sort                        Date: 06-13-03 (  :  )       
'  Author: Brian Aykut                        Code: Qbasic, QB, PDS, PB    
'  Origin: zurna9@hotmail.com               Packet: ALGOR.ABC
'===========================================================================
'(start of sort.bas)
'This program sorts the items in the array item
'written by:Brian Aykut (zurna9@hotmail.com
'feel free to use this code for any freeware or other
'non-commercial product, if u use this i would appreciate
'a mention somewhere thanks ;)

items = 10                      'how many items you have you wanna sort
DIM item(1 TO items) AS STRING  'Change data-type to sort things other 
than 
strings
DO WHILE sorted < items         'loop untill all are sorted
sorted = sorted + 1
x = sorted                      'reset x for 2nd loop
lowest = sorted
DO WHILE x < items              'find next lowest item
x = x + 1
IF item(lowest) > item(x) THEN  'change to < for sorting in decending 
order
lowest = x
END IF
LOOP
SWAP item(lowest), item(sorted) 'put it in its place
LOOP

'(end of sort.bas)
