``

prev Menu next

CHARACTER INPUT #

`CHARACTER INPUT #Channel_Number : string_variable`
reads a character from the file.
The character set is the Microsoft Windows default character set.
if a character consists of 2 bytes, 2 bytes may be read once.
Refer to Option Compatibility
If you want to read a byte always, write
`OPTION CHARACTER BYTE`
in the beginning of the program unit
The following forms of CHARACTER INPUT statements may be useful for COM-ports.
If more than one clause is included, they are written puctuated by commas.
`CHARACTER INPUT #Channel_Number ,CLEAR : string_variable`
erases the buffer before input, if the channel has an input buffer.
`CHARACTER INPUT #Channel_Number ,NOWAIT : string_variable`
does not wait for input. string_variable remains the former if no character is input.
`CHARACTER INPUT #Channel_Number ,TIMEOUT numeric_expression : string_variable`
raises an exception of extype 8401 if no input relay is given within the specified seconds.
`CHARACTER INPUT #Channel_Number ,ELAPSED numeric_variable : string_variable`
The time (in soconds) that elapsed until the input reply is given is assigned to numeric_variable.
`ASK #Channel_Number : CHARACTER PENDING numeric_variable`
The number of characters (in bytes) staying on the buffer is assigned to the variable.
`ASK #Channel_Number : TYPEAHEAD string_variable`
tests if the channel have an input buffer. The result is one of "YES"，"NO" or "UNKNOWN".
Refer to `CHARACTER INPUT`

Note.
Decimal BASIC does not defines the end-of-line character for CHARACTER INPUT. Therefore, if the program unit contains OPTION CHARACTER BYTE, byte access for a binary file is possible.