| PUTBYTES | |
| Syntax | PUTBYTES integerlist integer (PUTBYTES integerlist integer channel) |
| Explanation | PUTBYTES writes to the output stream the
ASCII characters corresponding to the elements of its
input list. A carriage return is not inserted, so if the
output of PUTBYTES is printed on the screen, the prompt
appears after the last character of the input list. Legal
input values are values between 0 and 255. PUTBYTES works
like the PRINTLINE command.
If a negative value is found, Logo waits for the
specified time in milliseconds after converting the
number into a positive value. This makes it possible to
send a few bytes, wait for a specified time, and then
send more bytes. A second input is a number that tells Logo to read the given number of bytes from the stream after the bytes have been output. These input bytes are output as a list of integers between 0 and 255. This feature makes PUTBYTES ideal for programming robots or other devices, where a stream of command bytes usually is followed by a reply from the robotic device. A channel number may be entered as a third, optional
input. If present, PUTBYTES writes to that channel
instead of writing to the output stream and reads the
reply from that channel as well. This makes it easier to
switch among multiple output streams. |
| Examples | OPEN.PORT 1 Result: 2 (PUTBYTES [#HC2 0 0] 2 2) Result: [1 0] CLOSE 2 |