Another Way To Save Data In Pro/File 2068

Authors

Publication

Pub Details

Date

Pages

When you’re running Pro/File 2068 and you type “SAVE” from the main menu, program line 107 is executed which performs a normal program save of the Basic program and all the variables including DS, the large character array which contains all your data. Many people have asked if it would be possible, instead, to save just the data and not the program lines.

There are two advantages to saving in this way. First, since you would not need to save the lines of the program, cassette times would be shortened. Actual time would vary depending on how many records you have added. Second, the data you save could be loaded into other programs–either other versions of Pro/File 2068 or completely different software.

There have been quite a few people who made some modifications to Pro/File 2068 only to discover that when they tried to Load their data into their new version, they also loaded in the old unmodified program lines. The only solution was to retype all the data back into the enhanced Pro/File.

By changing the Save/Load procedures, you won’t need to re-enter all that data. Saving time will be shorter, and you will be able to isolate the data from the program. This means you can write other Basic programs to operate on your files in a way that Pro/File does not (such as a search and replace procedure).

This technique converts the old program save and load into a CODE save and load. Alter the Basic lines 107 and 5510 so they read as follows. You will need to do this in every copy of Pro/File you use. After the lines are changed, use the GO TO 1 command to get the program running again. Now, with a spare cassette in your recorder, type “SAVE” from the main menu to save just your files.

107 IF x$="SAVE" THEN LET d$( TO 5)=STR$ p: SAVE f$CODE 6+PEEK 23627+256*PEEK 23628,p: LET d$( TO 5)="*SEAR": GO TO 1
5510 PRINT AT 16,1; PAPER 5; INK 0;"WHAT FILE NAME DO YOU WISH ";at 17,1;"TO LOAD ";: INPUT F$: PRINT f$: LOAD f$CODE 6+PEEK 23627+256*PEEK 23628: LET p=VAL d$( TO 5): LET d$( TO 5)="*SEAR": GO TO 1

After each Pro/File you have is saved in this way, follow the instructions on page 99 of the big book to make a back-up copy of your original master. Once step 5 is completed, alter lines 107 and 5510 just as you did above. Then finish executing steps 6 through 9 of the back-up making procedure.

When you’re finished, your new version will operate in exactly the same way as before except saving and loading times will be reduced dramatically.

What do lines 107 and 5510 do? You can read in the 2068 operator’s manual that the SAVE “name”CODE command, sends raw bytes of memory out to the tape recorder. You must tell the machine the address of the first byte and the number of bytes to send. Since D$ is always the first variable stored in memory, it is easy to calculate its beginning address by peeking the VARS system variable (23627 and 23628) and adding 6 to it. The Basic variable, P, always tells how many bytes of D$ actually hold data. These two items provide the necessary information so the computer will know what and how much data is to be saved.

Because each save varies in length, Pro/File must update the variable P after a load so its new value corresponds with the newly loaded data. That’s why the first part of line 107 says,

LET D$( TO 5)=STR$ p

Normally the first five characters of D$ will be the beginning of the *SEARCH IS COMPLETE file. Line 107 temporarily overwrites this with the number P. After the save is finished, the same line restores D$(1 to 5) to its old self.

Therefore, when line 5510 is called upon to load data, the computer looks at the first 5 characters to get the corresponding value for P. Before line finishes, it too, restores these 5 characters to “*SEAR” so Pro/File will function correctly.

Because data is saved as CODE (as opposed to DATA D$), you must load the files into other programs as CODE as well. On the surface, it would seem that this is less than ideal because most often you’d like to load it as a string. Actually, this approach is more versatile. In addition to being able to load the data as CODE, you can also do just what Pro/File does–create an array first, then fill it up with the CODE. Essentially, all you have to do is work up a program line that looks something like this:

CLEAR: DIM D$(28000):LOAD ""CODE 6+PEEK 23627+256*PEEK23628

The CLEAR command insures that D$ which is created by the next statement will be the first variable in memory and therefore at the address calculated by peeking VARS.

In the dimension statement above, there is nothing that prevents you from making D$ any size you wish as long as you don’t try to make it smaller than the value for P. In other words D$ can be anything larger than P. If P equals 2000, you could Dim D$ to any size greater than 2000. But don’t try to make it smaller. That’s like trying to stuff 10 pounds of mud in a 5 pound sack. It just won’t work. Re-dimming D$ to a smaller size is very useful at times, but means that whatever data is stored in the array will be lost. This trick lets you save off your files, put them in a smaller array without having to retype everything back in by hand.

Products

Downloadable Media

 
Scroll to Top