beautypg.com

Remote Processing CAMBASIC User Manual

Page 55

background image

Comm ands - 22

COM$

Process Function

SYNTAX:

n$ = COM $(n)

PURPOSE:

To return a string from the serial input buffer. This function is usually used in conjunction with ON
COM $.

REMARK S:

n = legal serial port number (1 or 2).

COM $ returns the characters in the buffer up to the terminating character (if specified) or the total
number of characters in the buffer.

When COM$ is executed, the characters in the buffer are removed. Immediately executing COM$
again will produce a null string.

RPC-2350 NOTE: The CAM BASIC statement BIT 128,4, 0 may need to be executed before you
will receive any characters. This command enables the CTS line to the sender.

RELATED:

C L E AR C O M $, O N C O M$ , C ON F I G C O M $

EXAMPLE:

See the ON COM $ statemen t.

ERROR:

< Data negative> – for n
< Illegal argument> – if n is not a legal serial port number