from Bob’s Notebook…..
As the title implies, this is about exploiting the LKDOS MERGE command to accomplish a special task.
Just recently, I was tinkering with an old BASIC program that I typed in years ago from a book on the ZX81; perhaps you remember it: it was called G.P.G.P (for General Purpose Graph Plotter). I had adapted it to the TS2068 about 1984 and used it for a few years tracking Gas and Hydro usage and later Gas Mileage/Kms for my car. The graphs were of the vertical pillar type as opposed to pie or line graphs. In my adaptation, the only “colouring” was white and black to differentiate between two sets of data on the same screen or printout.
The Larken LKDOS version 3 came along and I decided to use the extended command CIRCLE to fill the pillar graphs with different shadings. This allowed me to display three sets of data on the same screen or printout, which was the original intent of the ZX81 program.
Suffice to say, the BASIC had developed quite a few changes from the earlier version I had been using. But now I had a new BASIC file without the data which had previously been entered; in fact I had a total of nine such files to convert and I did not relish the idea of re-entering all this data from scratch. I cast about for a way to preserve the data (ie, the variables) and transport them to the newly amended BASIC files. Could I MERGE the values into the new BASIC?
I dug out the Larken manual and reread the MERGE part. Here’s what it says (in part):
“The MERGE command differs from the cassette MERGE in a few ways. (One of them is that it) doesn’t merge program variables, only the program lines. This makes your BASIC overlay programs easier to program.”
What this meant was that I could not MERGE the variables into the new BASIC file, but I could MERGE the new BASIC file into the variables. I had never done this before but now was the time to try. Let’s call the old file “graphO.Bx” and the new one “graphN.Bx”.
The procedure I used was straight-forward enough:
1) LOAD the old program with all its variables intact (RANDOMIZE USR 100: LOAD “graphO.Bx”) and;
2) DELETE all the BASIC lines (DELETE 1,9999). Without a listing, the screen was blank but all the variables were still there. This could be demonstrated by a simple PRINT (variable name). At this point, I could have saved the variables under a different BASIC name, but this was not necessary or desirable for this particular exercise.
3) Instead, the next step was simply to MERGE the new BASIC (RANDOMIZE USR 100: MERGE “graphN.Bx”). Note that there was no need to save the variables as a CODE file with all the complex programming that entailed. Only BASIC files are used in this method.
It was an odd use of MERGE because there really weren’t two files of lines to work on. But the original variables were now incorporated into the new program. Warning! It can take a few moments for the LKDOS MERGE routine to do its work but then the program is there ready to use.
To recap, remember you cannot MERGE variables even in their own separate program. You have to LOAD them first and then MERGE the BASIC listing.
This is not a feature that you might use very often but make a note of this for the future. Once again, the LKDOS V3 was shown to have another gem that confirms it to be the best of the TS2068 DOSs. Can any of the others do as much?
PS. If there are any requests for the GPGP file, I can put a copy into the club library. Here is a sample output from the program to give you some idea of the graphics.

Bob Mitchell 910515.