C THIS SUBROUTINE ACCEPTS THREE ARGUMENTS: C C A - AN ARRAY TO BE SORTED C N - THE DIMENSION OF THE ARRAY C B - AN ARRAY TO RECEIVE THE SORTED CONTENTS C OF A C C A BUBBLE SORT IS USED TO SORT THE DATA C INTO ASCENDING ORDER C SUBROUTINE SORT(A,N,B) C C The following programs are used in the RT-11 User and RT-11 C Programmer self paced instruction courses for RT-11 V4.They are also C similar to programs used in the Programming with RT-11 series for C RT-11 V5.0 or later. The name of the files are as specified in the C self paced course. C C The code is supplied as a service as Digital does not supply these C on diskette. C Any copyright is the property of Digital Equipment Corporartion C LOGICAL SWITCH DIMENSION A(N),B(N) C DO 100 I=1,N 100 B(I)=A(I) C 200 SWITCH=.FALSE. DO 300 I=1,N-1 IF(.NOT.(B(I).GT.B(I+1))) GO TO 300 T=B(I) B(I)=B(I+1) B(I+1)=T SWITCH=.TRUE. 300 CONTINUE C IF (SWITCH) GOTO 200 RETURN END