Skip to content

Instantly share code, notes, and snippets.

@jhubble
Last active December 19, 2022 02:57
Show Gist options
  • Save jhubble/54a1aa6c996b2b96296b3782072f5efa to your computer and use it in GitHub Desktop.
Save jhubble/54a1aa6c996b2b96296b3782072f5efa to your computer and use it in GitHub Desktop.
Print directory listings for commodore 64 sequential or program files. Manually typed in from an old printout, so may have some errors. quick_directory_misc
5 DIMN$(144)
6 SP$=" "
10 PRINT"MINI LISTER"
20 PRINT"LIST PROGRAM SEQUENTIAL, OR ALL":F=0
30 GETA$:IFA$=""THEN30
40 IFA$="P"THENF=1:GOTO65
65 PRINT" PRESS ANY KEY WHEN PRINTER ON LINE, AND"
66 PRINT" DISK IS IN DRIVE READY TO BE CATALOGED":POKE198,0:WAIT198,1
67 OPEN4,4:POKE198,0
70 OPEN1,8,0,"$0
80 GET#1,A$:IFA$<>CHR$(34)THEN80
85 PRINT#4,CHR$(14)" TITLE:";
90 GET#1,A$:IFA$<>CHR$(34)THENPRINT#4,A$::GOTO90
100 GET#1,A$,B$,C$:PRINT#4," ID:";B$C$CHR$(15)
105 PRINT"READING"
110 GET#1,AA$:IFST>63THEN180
115 IFA$<>CHR$(34)THEN110
116 PRINTSPC(PN)"READING....."
120 GET#1,A$:IFA$<>CHR$(34)THENN$(PN)=N$(PN)+A$:IFST<64THEN120
121 IFST>63THEN180
125 GET#1,B$:IFB$<"A"THEN125
130 GET#1,C$,D$:A$=B$+C$+D$:IFF=1ANDA$<>"PRG"THENN$(PN)="":GOTO110
140 IFF=2ANDA$<>"SEQ"THENN$(PN)="":GOTO110
145 PN$=STR$(PN):N$(PN)=MID$(PN$,2,LEN(PN$)-1)+"."+N$(PN)
150 IFLEN(N$(PN))<20THENN$(PN)=N$(PN)+LEFT(SP$,19-LEN(N$(PN)))
155 N$(PN)=LEFT$(N$(PN),19)
160 PN=PN+1:GOTO110
180 C=INT((PN/4):D=C+1:E=D+D:F=E+D:Q$=CHR$(34)
190 FORA=0TOC:PRINT#4,Q$N$(A)N$(D+A)N$(E+A)N$(F+A)Q$:NEXT
1000 OPEN15,8,15:INPUT#15,A,B$,C,D:IFA>0THENPRINT"ERROR"A;B$C;D:CLOSE15:END
1010 CLOSE 15:END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment