The LB sort command is good for almost all cases, but in this case, I needed to sort some print lines on a field in the middle of the line, so I used the bubble sort.

It compares pairs of lines and flips them if the second one is lower than the first one.

r.m.

**Code:** FOR i=1 TO chosenCtr 'sort to time sequence
FOR j=1 TO (chosenCtr-1)
IF mid$(classChosen$(j),17,4) > mid$(classChosen$(j+1),17,4) THEN
temp$ = classChosen$(j)
classChosen$(j)=classChosen$(j+1)
classChosen$(j+1)=temp$
END IF
NEXT j
NEXT i