Open "d:/SequentialFile1" for INPUT as #52
Seek #52, Seek(1)
This won't work at all the way you have it, nor for what you're trying to use it for. Bare with me a bit, as I try and explain these various commands.
SEEK #55,
whatever --- this is a SUB which you're calling.
https://wiki.qb64.org/wiki/SEEK_(statement) It basically is a way to telling the program to move the file pointer to
whatever position you want it at.
, Seek(1) --- this is the FUNCTION which you're calling.
https://wiki.qb64.org/wiki/SEEK It basically is a way of your programing asking where the file pointer of some file is currently at.
So: SEEK #52, Seek(1) is basically saying:
Move the file pointer on (filehandle 52) to wherever the file pointer on (filehandle 1) is currently positioned.
Since you don't have an OPEN whateverFile$ FOR INPUT/OUTPUT AS
#1, you're going to get an error as there's no open filehandle 1.
So, that's the FIRST reason why what you're trying isn't going to work.
The second reason is due to you OPENing the file in question FOR INPUT.
SEEK (as the SUB version) will place you directly at whatever byte you want to go to -- it doesn't track record positions at all. It's only when you OPEN FOR RANDOM, that SEEK will move from one record to the next...
INPUT/OUTPUT/BINARY -- SEEK moves to byte position
RANDOM -- SEEK moves to record position
So, the only way something like this would be somewhat valid would be if:
OPEN "d:/SequentialFile1" For Random AS #52
Seek #52, Seek(52) + 1 'move to next record
Notice how all my file handles reference the same file, and that it's an Open For Random file?
I'm thinking the above is close to what you're shooting for, but I'm not certain as the original isn't really code which can do anything except error on you. What exactly are you trying to do with the code here, after all?
OPEN "d:/SequentialFile1" For Random AS #52
Seek #52, 1 'move to first record
Seek #52, 3 'move to third record
Seek #52, Seek(52) + 2 'move two records past the current one