I kind of hate to say this, but I’m going to change the way we save data only. There are several reasons for this. First, it insures better compatibility with any changes Tom Woods may come up with because the order of the main variables will be restored to their original status. Second, it will allow data to be easily moved from different versions of PRO/FILE even if the length of D$ is different (however, D$ must be at least as long as the value held by P or the program won’t work). Third, I have an idea for a routine that requires this new system.
If you are going to convert to a Spectrum version then you must make this change because the lines dealing with the microdrive save and load routines assumes you have!
First we must save the data much as we did in issue #1 with some adjustments since the data is now in a different position. To simplify matters we will make the adjustments in the data save routine first. It is also necessary that you have previously saved only the data as the program presently allows to make this easier to handle. Line 8205 will be further adjusted after the files are transferred.
100 LET T1=O: INPUT "SEARCH COMMAND? ";X$
103 IF X$="AUTO" THEN GO TO VAL "5200"
8205 CLS : ON ERR GO TO VAL "8000": IF X$="D" THEN LET D$(H TO G+F)=F$: LET D$(K+H TO J+U)=STR$ P: SAVE F$CODE PEEK VAL "23627"+R*PEEK VAL "23628"+K+H,P: GO TO VAL "8220"
8230 BEEP U/H,J+J: GO TO U
Now load in each of your data tapes. As each one is loaded you should immediately resave and verify it (as data only!) on another tape before doing anything else. When a data file has been saved and verified, load in the next data file to be transferred and repeat the process.
When all the data has been saved this new way, we can change our lines for loading it back in and also adjust line 8205 slightly. First POKE 64095,6 and POKE 64754,6 to correct the machine code routines then:
3 LET D$( TO K+K)="*SEARCH IS COMPLETE*": POKE VAL "23609",E: LET J$="": LET A=O: LET X$="": LET T=O: LET T0=O
1080 IF PEEK VAL "63026"+R*PEEK VAL "64027"<>PEEK VAL "23627"+R*PEEK VAL "23628"+G-U AND (Y$="D" OR Y$="E") THEN GO TO VAL "4000"
5505 PRINT AT J+U,U;" LOAD DATA ONLY? (Y OR N) ": PAUSE 0: LET X$=INKEY$: IF X$="Y" THEN LOAD ""CODE PEEK VAL "23627"+R*PEEK VAL "23628"+G-U: LET F$=D$(H TO G+F): LET P=VAL D$(K+H TO J+U): BEEP U/H,VAL J+J: GO TO U
8205 CLS: ON ERR GO TO VAL "8000": IF X$="D" THEN LET D$(H TO G+F)=F$: LET D$(K+H TO J+U)=STR$ P: SAVE F$CODE PEEK VAL "23627"+R*PEEK VAL "23628"+G-U,P: GO TO VAL "8220"
9850 PRINT "FILE: ";INK G;F$; INK F=U;" ORDER : ";INK G;S, INK F-U;"OPEN: "; INK G;LEN D$-P;: PRINT "bytes";TAB O;: PRINT "FORMAT:"; INK G;A$,,,TAB O;: RETURN
9996 DIM D$(VAL "28020"): LET P=VAL "20":LET O=NOT PI: LET B=O: LET U=SGN PI: LET H=U+U: LET F=H+H: LET G=VAL "7": LET K=VAL "10": LET J=VAL "15": LET Q=CODE " ": LET R=VAL "256": LET A$="ALL": LET C$="": FOR X=U TO J: LET C$=C$+CHR$ X:NEXT X: LET S=O
Now save a new master copy with RUN 9990 for as many copies as you want. This new master will accept the new data tapes we made.