Hi Bplus
Hi guys
I must affirm that with the previous codes and with this one below Ihave got the same results in QB64 and in QBasic!
So I think that QB64 is duplicating the behaviour of Qbasic.
' test seek for INPUT file access
IF k
= 1 THEN s1$
= "1234567": s2$
= "890" ELSE s1$
= "abcdefg": s2$
= "hij"
see here
[ You are not allowed to view attachments ]
[ You are not allowed to view attachments ]
[ You are not allowed to view attachments ]
IMHO the code works as aspected....
creating a file and after reading from this
prints on screen the position of the pointer into the sequential file opened as output
with
we set the pointer to the file at position 2nd byte from beginning
and in fact we got as output a first string starting from the 2nd byte "2" or "b"
and the loop
activates no error of access behind the end of file!
So about
if then seek back to any position between 1 and less than the length of the file the eof() will still return -1
in qb eof() was reset by seeking to a position less than the length of file.
it has no confirm in my experience.
But if I use code posted at #4 post by Bplus I find a difference between Qbasic and QB64....
see here
[ You are not allowed to view attachments ]
So the questions are:
1.
how can I SEEK numFile,Position behind the EOF? it is possible both in Qbasic both in QB64!
2.
why does the code posted in this post by me work? the SEEK 1,2 sets the position at 2nd byte and the reading of file starts there.
Here we need more data to fix the bug!