Blast from the past… This code is over 30 years old and includes tips for organizing electronic files using qbasic – it is a condensed program that helps you organize all your files and make the process of labeling easy.

Only catch is, it’s old and centered around a programming language no longer used and floppy disks that are long gone, before the high capacity 720k hard floppy. Remember those 720 3.5 disks? You could save a ton using a Phillips screwdriver to twist a hole into the top corner which resulted in doubling the capacity…

Anyway, I have been organizing (in hopes of being more efficient…) and came across a print out with this code on it. I just had to scan and post. It’s more for myself than for anyone else.

A$=INKEY$:WHILE A$<>””:A$=””:GOTO 12:WEND
15 CLS:KEY OFF:COLOR 7,9:CLS:PRINT:PRINT:COLOR 14,0
20 PRINT”?????????????????????????????????????????????????????????
25 LOCATE 4,1:COLOR 14,0:PRINT”?”;:COLOR 15,0:PRINT” Initialize List Print Change Search End Help”;:COLOR 14,0:PRINT” ? ”
30 PRINT”?????????????????????????????????????????????????????????”
35 LOCATE 6,2:PRINT SPC(57)
40 COLOR 7,9:FOR T=10 TO 30:PRINT SPC(60):NEXT:COLOR 0,0:LOCATE 4,2
45 A$=INKEY$:IF A$=”” THEN 45 ELSE COLOR 14,0
50 IF A$=”i” OR A$=”I” THEN NUM=1:LOCATE 4,5:COLOR 4,0:PRINT”I”:COLOR 7,0
65 IF A$=”l” OR A$=”L” THEN NUM=2:LOCATE 4,17:COLOR 4,0:PRINT”L”:COLOR 7,0
70 IF A$=”p” OR A$=”P” THEN NUM=3:LOCATE 4,23:COLOR 4,0:PRINT”P”:COLOR 7,0
75 IF A$=”c” OR A$=”C” THEN NUM=4:LOCATE 4,30:COLOR 4,0:PRINT”C”:COLOR 7,0
80 IF A$=”s” OR A$=”S” THEN NUM=5:LOCATE 4,38:COLOR 4,0:PRINT”S”:COLOR 7,0
85 IF A$=”e” OR A$=”E” THEN NUM=6:LOCATE 4,46:COLOR 4,0:PRINT”Q”:COLOR 7,0
87 IF A$=”h” OR A$=”H” THEN NUM=7:LOCATE 4,51:COLOR 4,0:PRINT”H”:COLOR 7,0
90 IF NUM<1 OR NUM>7 THEN GOTO 45
95 ON NUM GOSUB 300,105,400,1300,1000,1200,1800
100 GOSUB 805:COLOR 7,9:CLS:GOSUB 810:RUN
105 GOSUB 510:COLOR 14,0:LOCATE 8,1:GOSUB 800
110 COLOR 7,9:PRINT” “;:COLOR 14,0:PRINT”????????????????????????????????”
115 COLOR 7,9:PRINT” “;:COLOR 14,0:PRINT”? File Name File Size ? ”
120 COLOR 7,9:PRINT” “;:COLOR 14,0:PRINT”???????????????????????????????? ”
125 FOR T=11 TO 21:COLOR 7,9:LOCATE T,6:COLOR 14,0:PRINT”?”;SPC(30);”? “:NEXT
130 COLOR 7,9:PRINT” “;:COLOR 14,0:PRINT”???????????????????????????????? ”
135 COLOR 7,9:PRINT” “;:COLOR 7,0:PRINT SPC(32):COLOR 14,0
140 LOCATE 10,44:PRINT”????????????????????????”
145 LOCATE 11,44:PRINT”? 7 up down 8 ?
150 LOCATE 12,44:PRINT”????????????????????????”
155 LOCATE 13,45:PRINT SPC(23)
160 LOCATE 16,44:PRINT”????????????????????????”
165 LOCATE 17,44:PRINT”? Disk Num…. ? ”
170 LOCATE 18,44:PRINT”? Total Files. ? ”
175 LOCATE 19,44:PRINT”? Space Avb… ? ”
180 LOCATE 20,44:PRINT”???????????????????????? ”
185 LOCATE 21,45:PRINT SPC(23)
190 IF WART=1 THEN WART=0:DK=QP:GOTO 200 ELSE STP=0:CNT=0:DK=1
195 Q$=STR$(DK):Q=LEN(Q$):Q$=RIGHT$(Q$,Q?1):QA$=”disk.”+Q$:OPEN QA$ FOR INPUT AS #1
200 INPUT #1,FIL$,EXT$,SIZ$:FIL$=FIL$+” “+EXT$+” “+SIZ$
205 IF EOF(1) THEN TF=VAL(EXT$):EXT$=””:TS=VAL(SIZ$):SIZ$=””:CLOSE #1:FIL$=””:COLOR 15,0:LOCATE 17,61:PRINT DK:LOCATE 18,61:PRINT TF:LOCATE 19,58:PRINT TS:GOTO 220
210 CNT=CNT+1:FIL$(CNT)=FIL$:SIZ(CNT)=SIZ
215 GOTO 200
220 FOR T=12 TO 19:LOCATE T,11:PRINT FIL$(T?11):NEXT
225 GOSUB 700:IF A$=”q” OR A$=”Q” THEN RETURN
230 IF A$=”4″ AND DK>1 THEN DK=DK?1:GOTO 500 ELSE IF A$=”6″ AND DK=1 THEN STP=STP?1:FOR T=12 TO 19:LOCATE T,11:PRINT SPC(25):LOCATE T,11:PRINT FIL$(STP+(T?11)):NEXT:Y=0:GOTO 225
245 IF A$=”2″ AND STP< =CNT THEN STP=STP+1:FOR T=12 TO 19:LOCATE T,11:PRINT SPC(25):LOCATE T,11:PRINT FIL$(STP+(T?11)):NEXT:GOTO 225 250 GOSUB 815:GOTO 225 300 IF DAY=1 THEN 305 ELSE DAY=1:GOSUB 800 305 MO=1:STRG1$=”Please Insert Dsk”:STRG2$=”and Press a Key” 310 GOSUB 600:GOSUB 700:STRG1$=”Reading Disk”:STRG2$=”Information”:GOSUB 600 315 D=D+A:Q$=STR$(D):1=LEN(Q$):Q$=RIGHT$(Q$,Q?1):QA$=”disk.”+Q$:D$=QA$ 320 COLOR 9,9:SHELL (“dir *.*>d:shift”):SHELL (“d:”):OPEN “SHIFT” FOR INPUT AS #1:OPEN D$ FOR OUTPUT AS #2:YUP=YUP+1:COLOR 14,0
325 FOR T=1 TO 4:INPUT #1,A$:A$=””:NEXT
330 INPUT #1,A$:IF EOF(1) THEN 340
335 FAME$=MID$(A$,1,8):FXT$=MID$(A$,10,3):FIZE$=MID$(A$,14,8):WRITE #2,FAME$,FXT$,FIZE$,GOTO 330
340 B=VAL(A$):B$=STR$(B):TLEN=LEN(A$):C$=MID$(A$,12,TLEN?11):C=VAL(C$)
345 WRITE #2,”*”,B$,C$,COLOR 9,9:SHELL (“del shift”):COLOR 14,0
350 CLOSE:STRG1$=”More? “:STRG2$=”[Y] or [N]”:GOSUB 600
355 GOSUB 810:GOSUB 700
360 IF A$=”N” THEN OPEN “totdsk” FOR OUTPUT AS #3:WRITE #3,D:CLOSE:GOTO 370
365 IF A$=”Y” THEN T=0:COLOR 7,9:SHELL (“a:”):GOTO 300 ELSE GOTO 355
370 D=0:STRG1$=”Insert Master Dsk”:STRG2$=”and Press a Key”:GOSUB 600
375 GOSUB 700:STRG1$=”Working…….”:STRG2$=””:COLOR 14,0,0:CLS:GOSUB 600:COLOR 0,0,0:SHELL (“d:”):SHELL (“copy disk.* a:”)
380 MO=0:SHELL (“copy totdsk a:”):SHELL (“a:”):COLOR 14,0:RETURN
400 OPEN “totdsk” FOR INPUT AS #3:INPUT #3,TOTDSK:CLOSE #3
405 STRG1$=”Working..”:GOSUB 800:GOSUB 600
410 COUNT=0:DK=1:CHIRP=1
415 COUNT=COUNT+1:Q$=STR$(DK):Q=LEN(Q$):Q$=RIGHT$(Q$,Q?1):QA$=”disk.”+Q$:OPEN QA$ FOR INPUT AS #1
420 LPRINT:LPRINT:LPRINT”DISK NUM….”;DK:LPRINT
421 SP$=INKEY$:IF SP$=”” THEN 422 ELSE IF SP$=”s” OR SP$=”S” THEN FLG=1
422 IF CHIRP=1 THEN CHIRP=0:STRG1$=”Printing..”:STRG2$=”(S) TO S)TOP”:GOSUB 600
425 INPUT #1,FIL$,EXT$,SIZ$:FIL$=FIL$+” “+EXT$+” “+SIZ$
430 IF EOF(1) THEN TF=VAL(EXT$):EXT$=””:TS=VAL(SIZ$):SIZ$=””:CLOSE #1:FIL$=””:GOTO 440
435 FIL$(COUNT)=FIL$:COUNT=COUNT+1:GOTO 425
440 FOR T=1 TO COUNT STEP 3:LPRINT FIL$(T),,FIL$(T+1):NEXT
445 LPRINT”Total Files ….”;TF
450 LPRINT”Total Space Avb.”;TS:IF FLG=1 THEN RETURN
455 DK=DK+1:IF DK>TOTDSK THEN RETURN ELSE COUNT=0:GOTO 415
500 LOCATE 11,1:FOR W=1 TO 10:COLOR 7,9:PRINT SPC(5);:COLOR 14,0:PRINT”? ? “:NEXT:FOR V=17 TO 19:LOCATE V,58:PRINT SPC(7):NEXT
505 CNT=0:STP=0:ERASE FIL$,SIZ:DIM FIL$(200),SIZ(200):GOTO 195
510 Z=1:OPEN “totdsk” FOR INPUT AS #3:INPUT #3,TOTDSK:CLOSE #3:GOSUB 800
515 STRG1$=”Disk 1 ?”+STR$(TOTDSK):STRG2$=”A ? A11″:GOSUB 600:PASS=50:QP$=””
520 A$=INKEY$:IF A$=”” THEN 520 ELSE IF A$=”A” OR A$=”a” THEN GOSUB 715:RETURN
525 IF A$=CHR$(8) THEN 515
530 PASS=PASS+1:IF PASS=54 OR A$=CHR$(13) THEN 545
535 QP$=QP$+A$
540 LOCATE 11,PASS:PRINT A$;:GOTO 520
545 IF VAL(QP$)<1 OR VAL(qp$)>TOTDSK THEN GOSUB 815:GOTO 515 ELSE QP=VAL(QP$)
550 COLOR 7,9:GOSUB 805:FOR Y=10 TO 14:LOCATE Y,34:PRINT SPC(35):NEXT:WART=1
555 Q$=STR$(QP):Q=LEN(Q$):Q$=RIGHT$(Q$,Q?1):QA$=”disk.”+Q$:OPEN QA$ FOR INPUT AS #1:RETURN
600 COLOR 14,0:LOCATE 10,34:PRINT”???????????????????????”
605 LOCATE 11,34:PRINT”? ?”
610 LOCATE 12,34:PRINT”? ?”
615 LOCATE 13,34:PRINT”???????????????????????”:LOCATE 14,35:PRINT SPC(23)
620 COLOR 15,0:LOCATE 11,36:PRINT STRG1$:LOCATE 12,36:PRINT STRG2#
625 STRG1$=””:STRG2$=””:COLOR 14,0:RETURN
700 A$=INKEY$:IF A$=”” THEN 700
705 IF A$=”y” THEN A$=”Y” ELSE IF A$=”n” THEN A$=”N”
710 IF A$=”Q” OR A$=”q” THEN RUN 100 ELSE RETURN
715 COLOR 14,9:GOSUB 805:FOR T=10 TO 15:LOCATE T,34:PRINT SPC(25):NEXT:COLOR 14,0:RETURN
800 FOR T=500 TO 900 STEP 20:SOUND T,.1:NEXT:RETURN
805 FOR T=900 TO 500 STEP ?20:SOUND T,.1:NEXT:RETURN
810 FOR T=1 TO 1000:NEXT:RETURN
815 SOUND 120,1.5:RETURN
900 OPEN “totdsk” FOR INPUT AS #3:INPUT #3,TOTDSK:CLOSE #3:IF TOTDSK<2 THEN RUN 100:ELSE TOTDSK$=STR$(TOTDSK):GOSUB 800
905 STRG1$=”Kill What File:”:STRG2$=TOTDSK$+” Total Files..”:GOSUB 600:QP$=””:PASS=50
910 A$=INKEY$:IF A$=”” THEN 910 ELSE IF A$=CHR$(8) THEN 905
915 IF A$=”q” OR A$=”Q” THEN RETURN
920 PASS=PASS+1:IF PASS=54 OR A$=CHR$(13) THEN 935
925 QP$=QP$+A$
930 LOCATE 11,PASS:PRINT A$;:GOTO 910
935 IF VAL(QP$)<1 OR VAL(QP$)>TOTDSK THEN GOSUB 815:GOTO 905 ELSE QP=VAL(QP$)
940 COLOR 7,9:GOSUB 805:FOR Y=10 TO 14:LOCATE Y,34:PRINT SPC(35):NEXT
945 Q$=STR$(QP):Q=LEN(Q$):Q$=RIGHT$(Q$,Q?1):QA$=”disk.”+Q$:KILL QA$
947 IF QP=TOTDSK THEN TOTDSK=TOTDSK?1:GOTO 960
950 LA$=STR$(TOTDSK):LA=LEN(LA$):LA$=RIGHT$(LA$,LA?1):LAST$=”disk.”+LA$
955 SHL$=”RENAME “+LAST$+” “+QA$:COLOR 7,9:SHELL SHL$:TOTDSK=TOTDSK?1
960 OPEN “TOTDSK” FOR OUTPUT AS #1:WRITE #1,TOTDSK:CLOSE:RETURN
1000 OPEN “totdsk” FOR INPUT AS #3:INPUT #3,TOTDSK:CLOSE #3
1005 STRG1$=”File to search for?”:GOSUB 800:GOSUB 600:PASS=35
1010 A$=INKEY$:IF A$=”” THEN 1010
1015 IF A$=CHR$(8) AND LEN(QP$)>0 THEN LOCATE 12,PASS:PRINT” “:PASS=PASS?1:LE=LEN(QP$):QP$=LEFT$(QP$,LE?1):GOTO 1010
1020 IF A$=CHR$(8) THEN GOSUB 815:GOTO 1010
1025 PASS=PASS+1:IF A$=CHR$(13) THEN 1040: ELSE IF PASS=50 THEN GOSUB 815:PASS=PASS?1:GOTO 1010
1030 QP$=QP$+A$
1035 LOCATE 12,PASS:PRINT A$;:GOTO 1010
1040 FOR B?1 TO LEN(QP$):TEMP$=MID$(QP$,B,1):TEMP=ASC(TEMP$)
1045 IF TEMP>96 AND TEMP<123 THEN TEMP=TEMP?32:TEMP$=CHR$(TEMP) 1050 CAP$=CAP$+TEMP$:NEXT:QP$=CAP$:CAP$=”” 1055 FOR QP=1 TO TOTDSK 1060 Q$=STR$(QP):Q=LEN(Q$):Q$=RIGHT$(Q$,Q?1):QA$=”disk.”+Q$:OPEN QA$ FOR INPUT AS #1 1065 INPUT #1,SFIL$,SEXT$,SBYT$:IF EOF(1) THEN CLOSE:NEXT:GOTO 1095 1070 FOND=INSTR(SFIL$,QP$):IF FOND>0 THEN FOND$=” Disk “+STR$(QP):GOTO 1909
1075 FOND=INSTR(SEXT$,QP$):IF FOND>0 THEN FOND$=” Disk “+STR$(QP):GOTO 1909
1080 FOND=INSTR(SBYT$,QP$):IF FOND>0 THEN FOND$=” Disk “+STR$(QP):GOTO 1909
1085 IF FOND=1 THEN STOP:FOND=0:CLOSE:GOTO 1090:ELSE GOTO 1065
1090 FLAG=1:STRG2$=”Press a Key..”:STRG1$=”Found in”+FOND$:GOTO 1100
1095 STRG1$=”File not found…”:STRG2$=”Press a key..”
1100 GOSUB 800:GOSUB 600:IF FLAG=1 THEN FLAG=0:GR=(LEN(SFIL$))?1:GR$=LEFT$(SFIL$,GR):LOCATE 10,38:COLOR 14,0:PRINT”??”;:COLOR 4,0:PRINT GR$+”.”+SEXT$;:COLOR 14,0:PRINT”??”
1105 GOSUB 700:RETURN
1200 COLOR 15,0,0:CLS:SYSTEM
1300 GOSUB 800:STRG1$=”K)ill or A)dd “:STRG2$=”A Disk?”:GOSUB 600:GOSUB 700
1305 IF A$=”k” OR A$=”K” THEN 900 ELSE IF A$=”a” OR A$=”A” THEN 1400
1310 RETURN
1400 OPEN “totdsk” FOR INPUT AS #3:INPUT #3,D:CLOSE:GOSUB 305:RETURN
1500 BEEP:FOR Y=1 TO 99:NEXT:IF ERR=24 THEN STRG1$=”NO Printer Available”:STRG2$=”Press a Key..”:GOSUB 815:GOSUB 600:GOSUB 700:RUN ELSE RUN
1600 DATA”INITIALIZE a disk: This option allows you to create your ”
1605 DATA”files before running the program, you must initialize the ”
1610 DATA”disk you wish to use. When choosing this option from the ”
1615 DATA”menu board, you will be asked to (Insert a Disk), you should ”
1620 DATA”insert the disk(s) you wish to keep track of and number each ”
1625 DATA”disk with the next higher number, 1 being for disk one etc.. ”
1630 DATA”At the (Insert Master Dsk) prompt, enter the disk that has this”
1635 DATA”program on it, the master disk. ”
1640 DATA”LIST your files: To view your files within a disk, use the ”
1645 DATA”up and down arrows. To look at a different disk, use the ”
1650 DATA”left and right arrow keys. ”
1651 DATA”?press any key to continue? ”
1655 DATA”PRINT will produce a hardcopy of all files on all disks. ”
1660 DATA”If for any reason you wish to stop printing, press (S) ”
1661 DATA”?press any key to continue? ”
1665 DATA”SEARCH will allow you to search for any file or program on ”
1670 DATA”any disk. You may enter the full name or just a portion of ”
1675 DATA”the name of the file you wish to locate. ”
1676 DATA”?press any key to continue? ”
1680 DATA”CHANGE will ask you to choose (Add or Delete): Here you can ”
1685 DATA”ADD or DELETE a disk. If you want to add a file to disk 12 ”
1690 DATA”for example, you must use the delete option to delete disk ”
1695 DATA”12 and then use the add option to add disk 12. ”
1700 DATA”The purpose of this program is to keep track of storage ”
1705 DATA”disks, to help you find a specific file fast and easy, and ”
1710 DATA”to produce hardcopys of this information. ”
1711 DATA”?press any key to continue?”
1715 DATA”SPECIAL NOTE: YOU MUST HAVE THE DISK CONTAINING THIS ”
1720 DATA” PROGRAM IN DRIVE (A:) BEFORE BOOTING UP ”
1725 DATA” YOUR SYSTEM, THE REASON FOR THIS IS THAT ”
1730 DATA” A (D:) DRIVE WILL BE CREATED AT BOOT?UP. ”
1735 DATA” THIS D: DRIVE WILL REMAIN INTACT AFTER ”
1740 DATA” YOU END THIS PROGRAM OR UNTIL THE COMPUTER ”
1745 DATA” IS EITHER RE?BOOTED OR TURNED OFF ”
1750 DATA” ”
1755 DATA” ”
1760 DATA” End of HELP ”
1765 DATA” ”
1770 DATA”*E”
1800 T=8:COLOR 11,9:S=300
1805 LOCATE T,15:READ A$
1810 IF A$=”?press any key to continue?” THEN COLOR 12,9:PRINT A$:GOSUB 700:COLOR 11,9:GOSUB 1830:GOSUB 1920:T=8:GOTO 1805
1815 IF A$=”*E” THEN COLOR 14,9:GOSUB 700:RETURN
1820 PRINT A$:T=T+1:GOSUB 1900:GOTO 1805
1830 FOR T=T TO 8 STEP ?1:LOCATE T,15:PRINT SPC(63):GOSUB 1910:NEXT:RETURN
1900 S=S+30:SOUND S,.5:RETURN
1910 S=S?30:SOUND S,.5:RETURN
1920 FOR R=1 TO 500:NEXT:RETURN

I saved up for this WOPR and purchased it from K-Mart. So awesome!!! One of the best feelings is creating your first program, discovering the bugs and fixing them – there is nothing like it!

More on the Commodore VIC-20

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.