<<

Contents

Search

>>

 

READCOMM$

 

 

Function

 

 

Syntax:

READCOMM$(<File Number>,<Count>)

 

<File Number>

= <NUM-EXPRESSION>

<Count>

= <NUM-EXPRESSION>

 

 

Meaning:

Reads data from a serial port.

 

READCOMM$ returns a string which contains, separated by semi-colon, the error code and the number of read characters. The error code = 0 if the data could have been read successfulyy, otherwise it is –1.

 

The variable EBUS_DATA$ contains the read data.

 

Parameter:

File Number

File number returned by OPENCOMM$

Count

Specifies the maximum number of characters to read.

 

Sample:

H$ = OPENCOMM$("COM1","9600,n,8,1",1024)

RET% = VAL(SUBSTR$(H$,";",1))

FILENR% = VAL(SUBSTR$(H$,";",2))

IF RET% <> 0

THEN ... Error ...

ENDIF

 

H$ = READCOMM$(FILENR%,100)

RET% = VAL(SUBSTR$(H$,";",1))

NUMBER_READ% = VAL(SUBSTR$(H$,";",2))

IF RET% <> 0

THEN ... Error ...

ELSE /* EBUS_DATA$ contains the read data

ENDIF

 

See also:

OPENCOMM$

WRITECOMM$

CLOSECOMM

EBUS_DATA$