10-01-2022, 02:44 PM
(09-27-2022, 10:13 PM)Pete Wrote: I'm not sure what you want.
If I want to change records in an existing database, without rewriting the entire file, I can do that easily with a RANDOM access file, or with a SEQUENTIAL file, like the one you are referencing, with a few tricks.
If you are talking about writing a new file name, then all you have to do is write a routine like Dimster described to make the next file, and do whatever you need to do to supply the data to fill that new file.'
Pete
I don't want to change the records that I have written in the sequential file but I don't want to have to go into the program and change the record number every time I want to add a file. The example I put up is repeated 16 times in my program because I don't know how to write a line that will change the record number and save the file. An example is;
310 ' -------------------------------------RECALL RECORD1.DAT
GOSUB 900 ' THIS CLEARS ALL VARIABLES
REC$ = (REC$ + "RECORD 1")
OPEN "RECORD1.DAT" FOR INPUT AS #1
FOR TTP = 1 TO 8
FOR X = 1 TO 3
INPUT #1, ALINE(X, TTP)
INPUT #1, TIME(X, TTP)
NEXT X
NEXT TTP
CLOSE #1
RESULTS = 854736
GOTO 360 ' --------- GO TO DATA BREAK DOWN
320 ' ---------------------------------------RECALL RECORD2.DAT
GOSUB 900 ' THIS CLEARS ALL VARIABLES
REC$ = (REC$ + "RECORD 2")
OPEN "RECORD2.DAT" FOR INPUT AS #1
FOR TTP = 1 TO 8
FOR X = 1 TO 3
INPUT #1, ALINE(X, TTP)
INPUT #1, TIME(X, TTP)
NEXT X
NEXT TTP
CLOSE #1
RESULTS = 431276
GOTO 360 ' -----------GO TO DATA BREAK DOWN
330 ' ----------------------------------------RECALL RECORD3.DAT
GOSUB 900 ' THIS CLEARS ALL VARIABLES
REC$ = (REC$ + "RECORD 3 ")
OPEN "RECORD3.DAT" FOR INPUT AS #1
FOR TTP = 1 TO 8
FOR X = 1 TO 3
INPUT #1, ALINE(X, TTP)
INPUT #1, TIME(X, TTP)
NEXT X
NEXT TTP
CLOSE #1
RESULTS = 746352
I am looking for a line that will ask me what record number I want to use to save to data and then ask me what record I want to recall without having to write each record separately. I hope this explains it better. Thanks for your reply