Classic Computer Magazine Archive COMPUTE! ISSUE 36 / MAY 1983 / PAGE 211

VIC File Case

John Stilwell

Nothing difficult. Just a straightforward, easy-to-use (how-did-I-manage-without it?) program for your VIC to keep track of files. For VIC's of any memory size.

I have a lot of fun playing games on my VIC-20, but I use it for work, too. I recently found that I needed a program to keep track of files – something versatile, so the format had to be simple. Since I couldn't find anything already written, I wrote my own.

The "File Case" is a set of 31 pages with ten entries per page. Because of the limited screen space, each entry can be no more than two lines long to prevent any scrolling.

Because of the "crunching" techniques I used when writing this program, some lines are longer than the maximum 80 columns. When typing in the longer lines, use abbreviations for the commands. For example, PRINT is entered as?.

Type N to start a new file. You will be asked to confirm and then to give the new file name. Note: This will erase any data already in the computer.

Type P and the page number you want; then push RETURN. The page shows ten entry numbers with a "-" after them. To make an entry, type E and type in the number (one of the ten displayed) on the page where you want it to go. After pressing RETURN again, type in your entry. The entry cannot include commas or colons. When you hit RETURN, it will appear on the page. When entering or inserting a line, if you want the line to appear in the catalog, it has to be reversed. To do this, type", then CONTROL RVS ON, and then type in your entry (all of this on the same line). When you hit RETURN, the entry will appear in inverse video on the page (white on black).

Type I to insert a line between two existing entries. An existing line may be deleted by typing K. This kills the specified line and moves up all succeeding lines. Type S to save your data on tape, and L to load the data back into the computer. Type? to get the definitions of the controls.

To cancel a control (except for Load, Save, or New), simply type any control letter instead of an entry number.

Pressing RETURN will move you to the next page. Type C to get the catalog. If any of your entries are reversed, they will appear next to the page number that they are on. The catalog can show only ten listings at a time. If you have more than ten reversed entries, push RETURN to get the next ten reversed entries.

If you are not using a memory cartridge, I suggest that the variable N in line 1 be changed from 309 to 109. This gives you only 11 pages to work with. If you want more or fewer pages to work with, then change this number by multiples of 10 only. The program will work with any memory configuration.

10 N=309 : X = (N+1)/10: DIMS$ (N): P = 1: POKE3687
    9,187
20 FORI = 0 TO N: S$ (I) = "-" =  : NEXT
30 PRINT "{CLEAR}"
40 GOSUB 590: IF A = 0 THEN PRINT" {03 UP}" : GOTO 4
   0
50 ONAGOTO60,140,220,260,330,390,450,510,5
   50
60 K = 0
70 Q=0 : PRINT "{CLEAR} {BLK} {REV} CATALOG :" ;
    T$: PRINT"   PAGE {PUR}"
80 FOR J = K TO N: IF ASC (S$ (J))= 18 THEN: PRINT INT
   (J/10+1);S$(J): Q = Q+1:    IF Q>9 THEN GOT
   O 100
90 NEXTJ
100 IF J > = NTHENGOTO40
110 PRINT "{DOWN} {REV} HIT RETURN TO CONTINU
    E {OFF}"
120 GETA$ : OFA$ = " " THEN 120
130 K = J + 1 : GOTO70
140 INPUT " {BLK} WHAT PAGE {PUR}" ; P$ : P = VAL(P$
    ) : A$ = p$ : GOSUB610 : IF A = 0 THEN 160
150 GOTO 40
160 IF P < LORP > XTHENPRINT "{02 UP}" : GOTO 140
170 PRINT "{CLEAR}{REV} {BLK} PAGE " P; T$: PRINT
"{PUR}" : FORI = 0 TO 9 : L = (P-1)*10 + I :PR
INT "{LEFT}" L;S$ (L); S$ (L): NEXT
180 GOSUB 590: IF A = 0 THEN 200
190 GOTO 50
200 P = P + 1: IF P > X THEN P = 1
210 GOTO 170
220 INPUT "{BLK} ENTER # {PUR}" ; R$ : R = VAL (R$) : A
    $ = R$ : GOSUB 610: IF A = THEN 240
230 GOTO40
240 IFR < 0 0RR > NTHEN PRINT" {02 UP} " : GOTO 220
250 INPUT S$ (R): GOTO 170
260 INPUT "{BLK} INSERT # {PUR}" ; R$ : R = VAL (R$):
    A$ = R$ :     GOSUB 610 : IF A = 0 THEN 280
270 GOTO 40
280 IFR < 0 ORR > NTHEN PRINT "{02 UP}" : GOTO 260
290 PRINT "{BLK} ENTER {PUR}" : INPUTD$ : PRINT "{
    BLK} IN    SERTING {PUR}"  : IF R = N THEN 170