Trailing-Edge
-
PDP-10 Archives
-
decus_20tap1_198111
-
decus/20-0020/index.uti
There are 2 other files named index.uti in the archive. Click here to see a list.
100' NAME--INDEX
110'
120' DESCRIPTION--MAKES AN INDEX. THE USER TYPES IN, IN ANY ORDER,
130' ENTRIES AND THEIR PAGE NUMBERS AS DATA. THE PROGRAM GROUPS
140' TOGETHER IDENTICAL ENTRIES, AND ALSO ALPHABETIZES.
150'
160' SOURCE--UNKNOWN
170'
180' INSTRUCTIONS--DATA BLOCK BEGINS IN LINE 1000. TYPE IN AS DATA
190' AN ENTRY, AND THEN THE PAGE NUMBER. REPEAT THIS CYCLE AS MANY
200' TIMES AS NEEDED WITHIN THE DATA STATEMENTS.
210'
220'
230' * * * * * * * MAIN PROGRAM * * * * * * * * *
240'
250 DIM W$(300),P(300)
260 FOR I = 0 TO 300
270 READ W$(I),P(I)
280 IF P(I) = -999 THEN 300
290 NEXT I
300 LET I9 = I-1
310 FOR I = 0 TO I9
320 FOR J = 0 TO I9-I-1
330 IF W$(J) <= W$(J+1) THEN 400
340 LET A$ = W$(J)
350 LET W$(J) = W$(J+1)
360 LET W$(J+1) = A$
370 LET A = P(J)
380 LET P(J) = P(J+1)
390 LET P(J+1) = A
400 NEXT J
410 NEXT I
420 LET B$ = W$(0)
430 LET I1 = 0
440 FOR I = 1 TO I9+1
450 IF W$(I) = B$ THEN 490
460 GOSUB 510
470 LET B$ = W$(I)
480 LET I1 = I
490 NEXT I
500 STOP
510 PRINT B$;
520 LET I8 = I-1
530 FOR K = I1 TO I8
540 FOR J = I1 TO I8+I1-K-1
550 IF P(J) <= P(J+1) THEN 590
560 LET A = P(J)
570 LET P(J) = P(J+1)
580 LET P(J+1) = A
590 NEXT J
600 NEXT K
610 LET I2 = I8-I1
620 FOR J = 0 TO I2
630 PRINT TAB(25+J*6);P(I1+J);
640 NEXT J
650 PRINT
660 PRINT
670 RETURN
1000 DATA MAX,15,MIN,27,SUM,81,MAX,72,MAX,15,MINIMUM,22,SUM,87,MAX,32
2000 REM DATA IN 3000 IS PART OF PROGRAM.
3000 DATA A,-999
4000 END