read from driver

Takes incoming data from a peripheral device that has been opened with the open driver command, and places the data in the it variable.

# Metadata

Platforms: desktop, server OS: mac, windows, linux Introduced: 1.1.1 Security:

# Syntax

read from driver deviceName [at start] {until {string | end | EOF | empty} | for amount [chunkType]} [in time]

# Params

- deviceName : The name of a device driver that's installed on the system and that you have previously opened with the open driver command. - start : The start specifies the character or byte position in the device's input where you want to begin reading. - string : When LiveCode encounters the string in the data coming in from the device, it stops reading. If the string is not encountered, the read from driver command continues reading as long as there is data to be read. - amount : A positive integer and specifies how much data to read. - chunkType : One of chars, characters, words, items, lines, int1, uInt1, int2, uint2, int4, or uint4. The read from driver command reads amount of the specified chunkType. If you don't specify a chunkType, amount characters are read. - time : The time to wait for the read to be completed, in milliseconds, seconds, or ticks.

# Examples

read from driver ".BIn" for 3 lines

read from driver it for 2 chars in 2 seconds

# Description

Use the read from driver command to get data from a peripheral device such as a modem.

The until string form reads data until the specified string is encountered. The until empty, until end, and until EOF forms read data until there is no more data to be read.

# Tags

# See

- **keyword:** it - **command:** open driver, write to driver, read from process - **function:** result - **control structure:** function - **glossary:** binary file, variable, command, peripheral device