mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-16 05:03:52 +00:00
b586eafd3b
LINE INPUT will now use the faster method if passed a file handle that has been opened FOR BINARY. As such, the _BLINEINPUT command has been removed. qb64.bas now takes advantage of this for reading from '$include files, at least in Include Manager 1. Some tweaking of internal/source/main.txt was required to get things into a sane state, so I'm holing off changing the compiler any further so the auto-builder can make sure everything's smoothed over. Note: Everything should still compile as normal; I'm just being overcautious.
31 lines
No EOL
1 KiB
Text
31 lines
No EOL
1 KiB
Text
The '''SEEK''' statement sets the next byte or record position of a file for a read or write.
|
|
|
|
|
|
|
|
{{PageSyntax}}
|
|
:: SEEK ''filenumber%'', ''position%''
|
|
|
|
|
|
|
|
* ''filenumber'' must be the file number that is [[OPEN]] and being read or written to.
|
|
* ''position'' is a byte in [[BINARY]] or sequencial files created in [[OUTPUT]], [[APPEND]] or [[INPUT (file mode)]]s. The first byte = 1.
|
|
* ''position'' is the record in [[RANDOM]] files to read or write. Records can hold more than one variable defined in a [[TYPE]].
|
|
* Since the first SEEK file position is 1 it may require adding one to an offset value when documentation uses that position as 0.
|
|
* After a SEEK statement, the next file operation starts at that SEEK byte position.
|
|
* The SEEK statement can work with the [[SEEK]] function to move around in a file.
|
|
|
|
|
|
''Example:'' A SEEK statement using the [[SEEK]] function to move to the next random record in a file.
|
|
|
|
{{CodeStart}}
|
|
SEEK 1, {{Cl|SEEK}}(1) + 1
|
|
{{CodeEnd}}
|
|
|
|
|
|
|
|
''See also:''
|
|
* [[SEEK]] {{text|(function)}}
|
|
* [[GET]], [[PUT]]
|
|
|
|
|
|
{{PageNavigation}} |