references/sleep-functions/readln.md

GitHub

readln

Category: InputOutput

Source: https://sleep.dashnine.org/manual/readln.html


Synopsis

$ readln([$handle])

reads a single line of text from the specified handle

Parameters

$handle - the handle to read from (defaults to stdin/stdout)

Returns

a scalar string with the read text. If no text is read then $null is returned instead.

Examples

Example:

$handle = openf("readfile.sl");

while $read (readln($handle))
{
# do something useful.
}

See Also

&bread; &readAll; &readb; &readc; &readObject; &setEncoding