INPUTBIN
Action

Read binary values from the serial port.

Syntax

INPUTBIN var1 [,var2]

INPUTBIN #dev, var1 [,var2]

Remarks

var1 The variable that is assigned with the characters from the serial port.
var2 An optional second (or more) variable that is assigned with the characters from the serial.
#dev Device number. For use with OPEN and CLOSE. Dev is the device number.
The number of bytes to read is depending from the variable you use.
When you use a byte variable, 1 character is read from the serial port.
An integer will wait for 2 characters and an array will wait until the whole array is filled.

Note that the INPUTBIN statement doesn't wait for a <RETURN> but just for the number of bytes.

See also
PRINTBIN

Example


Dim a as Byte, C as Integer
INPUTBIN a, c 'wait for 3 characters

End

'This code only for 80517 and 80537 with dual serial port
Open "COM2:" For Binary As #1 'open serial channel 1
INPUTBIN #1, a
Close #1