Interface IFileChannelInput
The reading side of an IFileChannel — the characters at and after its current file-pointer-position (MS-VBAL §5.4.5).
public interface IFileChannelInput
Remarks
Character-mode reading, which is what Line Input # and Input # do: the specification
describes both as consuming bytes that are "converted in an implementation dependent manner" into data
values, so the bytes-to-characters step belongs to the channel — the only thing that knows its own
encoding — and the statements above it see characters.
👉 Binary- and random-mode record I/O addresses records rather than characters, so it has a surface of its own beside this one: TryReadRecord(VBType, int, out VBTypedValue?) and TryWriteRecord(VBTypedValue, bool, out int).
Properties
IsEndOfFile
Whether there are no characters at or after the current file-pointer-position — which is
what EOF reports, and what makes a character-mode read raise error 62.
bool IsEndOfFile { get; }
Property Value
Methods
Peek()
The character at the current file-pointer-position, without consuming it.
int Peek()
Returns
- int
The character, or
-1at end of file.
Read()
The character at the current file-pointer-position, advancing past it.
int Read()
Returns
- int
The character, or
-1at end of file.
ReadLine()
Reads from the current file-pointer-position through the end of the current line (MS-VBAL §5.4.5.6), leaving the position after the line termination sequence.
string? ReadLine()
Returns
- string
The line, or
nullwhen IsEndOfFile already wastrue.
Remarks
The line termination sequence is not part of the result. A line ended by the end of the file rather
than by a terminator still reads as a line — the specification says so outright — so an empty string
and null mean different things here.