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 bytes to the port, if possible. PORTWRITEARRAY outputs 1 on success and 0 on failure.

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

Example
PORTOPEN "com1
PRINT SENTENCE [Sending...] PORTWRITEARRAY 3 LISTTOARRAY MAP [ASCII ?] [a t]
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