Back to Main page.
Back to Main tapes page.
10  REM: LIST - Program to list programs in ASCII DISK files on the teletype
20  REM:        so that the print head does not extend beyond the width of
30  REM:        the paper - by Steve Spear
40  DIM A$[255],A0$[36],B$[255],C$[255]
50  FILES *,*
60  REM:        Typing the filename followed by a "/P" will list the program
70  REM:        and page out after every 56 lines of output.
80  PRINT '7;
90  ENTER 1,A,A$
100  IF A>-1 THEN 210
110  PRINT "This program formats programs that have been placed in"
120  PRINT "ASCII files so that the print head will not extend beyond"
130  PRINT "the width of your terminal.  To place your program in an"
140  PRINT "ASCII file type: FILE-OUTPUT,DS,(file length)"
150  PRINT "followed by: LIST*OUT=OUTPUT*"
160  PRINT "then type:   EXE-LIST.idcode"
170  PRINT "When the program types 'Input file = ', type 'OUTPUT'"
180  PRINT "followed by a '/P' if you want the listing paged."
190  PRINT "Next time you run this program hit the 'return' key"
200  PRINT "when the bell rings.  '/N' will provide automatic nesting."
210  PRINT "Input file = ";
220  LINPUT A$
230  A$=UPS$(A$)
240  Q=POS(A$,"/")
250  N1=POS(A$,"/N")
260  C$[1,255]=" "
270  N=0
280  N2=3
290  A$=A$[1,LEN(A$)* NOT Q MAX Q-1]
300  ASSIGN A$,1,A
310  ASSIGN A$,2,B
320  IF A<3 AND B=6 THEN 350
330  PRINT "?BFS     bad file status."
340  GOTO 210
350  PRINT "TTY width: ";
360  ENTER -1,A,W
370  PRINT 
380  I=1
390  IF A<1 THEN 350
400  IF  END #1 THEN 990
410  LINPUT #1;A$
420  PRINT "Program: ";
430  IF A$<"?" THEN 460
440  PRINT A$;
450  GOTO 470
460  PRINT "*NO*NAME*";
470  SYSTEM A$,"tim"
480  PRINT SPA(3)"Account: "A$[1,4];
490  REM:  TIME - FORMAT: HH:MM:SS(am or pm) 
500  A$="00:00:00am"
510  A=TIM(I)-12*(TIM(I)>12)
520  CONVERT A TO A$[I+(A<10),2]
530  CONVERT TIM(0) TO A$[4+(TIM(0)<10),5]
540  CONVERT TIM(4) TO A$[7+(TIM(4)<10),8]
550  IF TIM(I)<11 THEN 570
560  A$[9,9]="p"
570  PRINT SPA(5);"Time: "A$;
580  DEF FNA(B)=A>B+L
590  A$="00-???-00"
600  A0$="JanFebMarAprMayJunJulAugSepOctNovDec"
610  A=TIM(2)
620  Y=TIM(3)
630  L=Y/4=INT(Y/4) AND Y
640  M=(A>31)+FNA(59)+FNA(90)+FNA(120)+FNA(151)+FNA(181)+FNA(212)+FNA(243)+FNA(273)+FNA(304)+FNA(334)+I
650  D=A-(30*((M>4)+(M>6)+(M>9)+(M>11))+31*((M>I)+(M>3)+(M>5)+(M>7)+(M>8)+(M>10))+28*(M>2)+(A>60)*L)
660  A$[4,6]=A0$[M*3-2,M*3]
670  CONVERT D TO A$[I+(D<10),2]
680  CONVERT Y TO A$[8+(Y<10),9]
690  PRINT  USING 700;A$
700  IMAGE3x,"Date:",x9a      
710  C=-1
720  IF  END #1 THEN 990
730  N=N+(POS(A$,"  FOR ")#0)
740  C=C+1
750  IF C#56 OR  NOT Q THEN 780
760  PRINT LIN(-9)
770  C=0
780  LINPUT #1;A$
790  N=N-(POS(A$,"  NEXT ")#0) MAX 0
800  IF  NOT POS(A$,"  ") OR  NOT N1 OR  NOT N THEN 840
810  B$=A$
820  A$[POS(A$,"  ")+1]=C$[1,N*N2+1]
830  A$[LEN(A$)+1]=B$[POS(A$,"  ")+2]
840  A=W
850  PRINT A$[1,A MIN LEN(A$)]
860  B=POS(A$," ")
870  IF LEN(A$) <= A THEN 720
880  PRINT SPA(B+1+N*N2);
890  FOR Z=A+1 TO A+W-(B+1) MIN LEN(A$)
900  PRINT  USING "#,A";A$[Z,Z]
910  NEXT Z
920  PRINT 
930  C=C+1
940  IF C#56 OR  NOT Q THEN 970
950  PRINT LIN(-9)
960  C=0
970  A=A+W-(B+1)
980  GOTO 870
990  END