Action
Print binary content of a variable to the serial port.
Syntax
PRINTBIN var [ ; varn]
PRINTBIN #dev, var ; [,varn]
Remarks
var |
The variable which value is sent to the serial port. |
varn |
Optional variables to send separated by a ;. |
#dev |
Device number for use with OPEN and CLOSE |
PRINTBIN is equivalent to PRINT CHR(var); but whole arrays can be printed this way.
When you use a Long for example, 4 bytes are printed.
See also
INPUTBIN , PRINT, PRINTHEX , INPUTHEX
Example
Dim a(10) as Byte, c as Byte
For c = 1 To 10
a(c) = a 'fill array
Next
PRINTBIN a(1) 'print content
'This code only for 80517/80537 with dual serial port
Open "COM2:" For Binary As #1 'open serial channel 1
PRINTBIN #1 , a(1) ; a(2) ; a(3) 'note that the channel is separated by a , and the vars by ;
Close #1