PORTWRITEARRAY

Synopsis
PORTWRITEARRAY count buffer
Description

PORTWRITEARRAY writes to the currently open port with the data in buffer, which must be an array of byte-sized integers. It attempts to write count many bytes to the port, if possible. It outputs the actual number of bytes written.

If count is larger than the size of the buffer array, then then entire array is written.

Example
PORTOPEN "com1
PRINT SENTENCE [Sending...] PORTWRITEARRAY 3 LISTTOARRAY MAP [ASCII ?] ARRAYTOLIST LISTTOARRAY "at
Sending... 2
SHOW PORTWRITECHAR 13
1
WAIT 60
MAKE "buff {0 0 0 0 0 0 0 0 0 0}
PRINT SENTENCE [Receiving...] PORTREADARRAY 10 :buff
Receiving... 9
PRINT SENTENCE [Data Rx...] MAP [CHAR ?] REMOVE [] ARRAYTOLIST :buff
Data Rx... at | |
O K |
PORTCLOSE

SourceForge.net Logo