Classic Computer Magazine Archive COMPUTE! ISSUE 50 / JULY 1984 / PAGE 6

"Filer" Modification

I have really enjoyed using the "Filer" program which appeared in October 1983 COMPUTE! "Beginner's Page." However, I would like to modify it to store and search any number of items (defined by variable T in line 1) without having to update T each time another item is added. Can you help me with this?

Richard Hamilton

You can allow for a varying number of items in your file by making just a few modifications to this program. First, delete line 1. Then, adjust the DIMension statement in line 3 to some maximum number of entries—say 50. Next, add the following lines:

10 I = I + 1 : READ A$(I), B$(I), C$(I)
12 IF A$(I) <> "END" THEN 10
13 T = I - 1
522 DATA END, 0, 0

In line 10, the variable I is the number of the item being READ. Line 12 checks for the end-of-data entry in line 522. If the end-of-data flag is not observed in line 12, the counter I is incremented, and another item (title, date, and author as A$(I), B$(I), and C$(I) is READ. Otherwise, no more DATA is READ and T, representing the actual number of items, will be set in line 13.