Read Statement
Reads characters from a file or communications port.
Syntax
Read #portNumber, stringVar$, count
Parameters
- Portnum
- ID number that specifies the file or communications port. File number can be specified in ROpen, WOpen, and AOpen statements. Communication port number can be specified in OpenCom (RS-232C) or OpenNet (TCP/IP) statements.
- stringVar$
- Specify the name of a string variable that will receive the character string.
- count
- Specify the number of bytes to read.
Notes
About the Controllers to use
For T/VT series, an error will occur at operation when RS-232C port of the Controller is specified.
See Also
ChkCom, ChkNet, OpenCom, OpenNet, Write, ReadBin
Read Statement Example
Integer numOfChars
String data$
numOfChars = ChkCom(1)
If numOfChars > 0 Then
Read #1, data$, numOfChars
EndIf