PORTREADCHAR

Synopsis
PORTREADCHAR
Description

Reads one byte from the currently open port and outputs it as an integer. It outputs "-1" if no character is available.

Example
PORTOPEN "com1
SHOW PORTWRITECHAR ASCII "a
1
SHOW PORTWRITECHAR ASCII "t
1
SHOW PORTWRITECHAR 13
1
WAIT 60
PRINT "Reading...
Reading...
REPEAT 10 [MAKE "x PORTREADCHAR IF NOT :x = -1 [TYPE CHAR :x]]
PRINT ".
at||
OK|
.
PORTCLOSE

SourceForge.net Logo