File DICHT.BA (BASIC source file)

Directory of image this file is from
This file as a plain text file

100 DIM Z$(72)
102 DIM Q$(20),R$(20)
105 DIM S$(72)
110 DIM M(300)
111 PRINT "PROGRAMM ZUM ENTFERNEN UEBERFLUESSIGER ZEILENNUMMERN"
112 PRINT "QUELLPROGRAMM:";\INPUT Q$
113 PRINT "ZIELPROGRAMM:";\INPUT R$
120 FILE#1:Q$
200 N=0
210 INPUT#1:Z$
220 IF END#1 GOTO 2000
300 P1=POS(Z$,"GOTO",1)
310 IF P1=0 GOTO 400
320 IF POS(Z$,"GOTO""",1)=P1 GOTO 400
325 P1=P1+4
330 GOTO 500
400 P1=POS(Z$,"GOSUB",1)
410 IF P1=0 GOTO 210
420 IF POS(Z$,"""GOSUB""",1)=P1-1 GOTO 210
425 P1=P1+5
500 X=VAL(SEG$(Z$,P1,LEN(Z$)))
510 FOR I=1 TO N
520 IF ABS(X-M(I))<0.5 GOTO 210
530 NEXT I
540 N=N+1
550 M(N)=X
560 IF X<>0 GOTO 210
570 PRINT "VORSICHT: MARKE 0 IN FOLGENDER ZEILE"
580 PRINT Z$
590 STOP
600 P1=POS(Z$,"THEN",1)
610 IF P1=0 GOTO 210
620 P1=P1+4
630 GOTO 500
2000 REM SORTIEREN
2100 FOR I=1 TO N-1
2110 M0=M(I)
2120 I0=I
2200 FOR J=I+1 TO N
2210 IF M0<=M(J) GOTO 2300
2220 M0=M(J)
2230 I0=J
2300 NEXTJ
2310 M(I0)=M(I)
2320 M(I)=M0
2330 NEXT I
2500 N=N+1
2510 M(N)=99999
2520 PRINT "DAS PROGRAMM ENTHAELT";N-1;"MARKEN"
3000 RESTORE#1
3100 FILEV#2:R$
3110 I=1\S$=""
3200 INPUT#1:Z$
3210 IF END#1 GOTO 6000
3220 P=POS(Z$," ",1)
3230 L=VAL(SEG$(Z$,1,P-1))
3250 IF ABS(L-M(I))<0.2 GOTO 5000
3260 IF L<M(I) GOTO 3300
3270 PRINT "LABEL ";M(I);" FEHLT"
3280 STOP
3300 PRINT#2:"   "&SEG$(Z$,P+1,LEN(Z$))
3320 GOTO 3200
5000 PRINT#2:Z$
5110 I=I+1
5120 GOTO 3200
6000 CLOSE#1
6100 CLOSE#2
6200 END



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search