Programming the TS2068: Opening Larken Files

See all articles from Sinc-Link v7 n5
Author(s): George Chambers
Publication: Sinc-Link
Pub Details: Sinc-Link v7 n5 (Volume 7, Issue 5)
Date: September/October 1989
Pages: 13

Bill Jones, in a program listing on LKDOS utilities in the July ’89 issue of TS UPDATE (pp 45&46), has a routine to selectively OPEN (and CLOSE) several Sequential files.

The method used was to name a series of files thusly: Dta1.A$, Dta2.A$, Dta3.A$, etc. Then one would INPUT a number 1, 2, 3, etc., to select the file containing the same numerical. Bill used a series of separate LINEs (9971, 9972, 9973, etc., to OPEN (and CLOSE) each file, and jumped to the appropriate line with an instruction like this:

INPUT "Enter a number(1-5)";zz: GOSUB 9970 + zz

He comments that: “…I couldn’t find a key to concatenate the titles with a number for either the OUT titles or the IN titles. This leaves the door open for someone to feed back the solution.”

Now, if you don’t have a copy of TS UPDATE this may not be clear, and it will take too much space to explain it here. But for all you TS UPDATE subscribers here is the word from one of our member contributors, Steven Gunhouse, to Bill Jones’ invitation.

To quote from Steve’s letter:

“…First a note relative to Bill Jones article. He asks how to concatenate a string and a number in his output sections. If someone has not beat me to it, here it is.

“First, since we won’t need his computed GOSUB’s any more, change every GOSUB 9970+zz to GOSUB 9970, and similarly change GOSUB 9980+zz to GOSUB 9980. Or change them to the appropriate contents of the two lines below – I didn’t check yet to see whether he uses these more than once.

“You may as well delete everything after 9970 with a DELETE 9970, Then type the following two lines:

9970 RANDOMIZE USR 100: OPEN #5,"Dta"+ STR$
zz +"A$ OUT ": RETURN
9980 RANDOMIZE USR 100: OPEN #5,"Dta"+ STR$
zz + "A$ IN ": RETURN

“For those that have trouble seeing that, recall that zz names a number, and we cannot concatenate a number to anything. But STR$ converts a number to a string, so it looks exactly like a number would be printed. This string can then be concatenated, sliced, or otherwise handled like any other string.” End of quote.

Websters…concatenate…to link together in a series or string

If any Larken owner member wants more details I can send you a copy of the relevant article.

G.F.C.