AsyncReadLineFrom (open)

Asynchronously read a line from any input device

Syntax

// Core function, no LOADLIB necessary

OBJECT FUNCTION AsyncReadLineFrom(INTEGER inputid, INTEGER maxnumbytes, BOOLEAN striplf)

Parameters

INTEGER inputid

Input device id

INTEGER maxnumbytes

(Maximum) number of bytes to read - the function will read until this limit or EOL is reached. This function never reads more than 32768 (32kB) in one call

BOOLEAN striplf

Strip the carriage returns or linefeed characters from the input

Return value

OBJECT

A promise that resolves to the read data

Description

This function reads from any input device, eg. a diskfile or a socket. This function reads the specified number of bytes or until the end of line is encountered.