1
QB64 Discussion / SEEK # or not SEEK #
« on: April 15, 2022, 12:02:52 pm »
Running into a bad file name or number error message when using Seek on a sequential file and not sure why.
Open "d:/SequentialFile1" for INPUT as #52
Seek #52, Seek(1)
The above is generating the error message. I have checked the name of the file I'm trying to open, and that the file is indeed on my "d" drive, also that the same opening statement works with Input #52.
I checked the wiki and the example it provides drops the "#" . The wiki has the seek statement as SEEK 1, Seek(1) ( ie there is no "#").
I'm not sure which is the correct statement but no matter, both with or without the "#" I'm getting the error message. I have also tried to be sure the file I'm trying to access is Closed before the Opening statement.
Any idea's on what I could be doing wrong, and which to the two Seek statements is the correct one?
Thanks
Open "d:/SequentialFile1" for INPUT as #52
Seek #52, Seek(1)
The above is generating the error message. I have checked the name of the file I'm trying to open, and that the file is indeed on my "d" drive, also that the same opening statement works with Input #52.
I checked the wiki and the example it provides drops the "#" . The wiki has the seek statement as SEEK 1, Seek(1) ( ie there is no "#").
I'm not sure which is the correct statement but no matter, both with or without the "#" I'm getting the error message. I have also tried to be sure the file I'm trying to access is Closed before the Opening statement.
Any idea's on what I could be doing wrong, and which to the two Seek statements is the correct one?
Thanks